Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Take a look at the enum:

enum TestEnum
{
    First = 1,
    Second = 2,
    Unknown = 3,
    TestTestTest = 100,
    Zero = 0,
    Foo = 123,
}

How can I use the whole power of Vim to reformat it?

enum TestEnum
{
    First           = 1,
    Second          = 2,
    Unknown         = 3,
    TestTestTest    = 100,
    Zero            = 0,
    Foo             = 123,
}

Personally, I'm moving line by line and tabbing. It is the same as I would do that in any regular editor. How to do that the right way?

The same for class members:

class Foo
{
    SuperFoo foo1;
    RegularFoo foo2;
    SuperiorFoo foo3;
    YetAnotherFoo foo4;
    Bar bar;
}

to something like

class Foo
{
    SuperFoo        foo1;
    RegularFoo      foo2;
    SuperiorFoo     foo3;
    YetAnotherFoo   foo4;
    Bar             bar;
}

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
135 views
Welcome To Ask or Share your Answers For Others

1 Answer

You can harvest from two plug-ins that can do this stuff:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...