Home > Tip, vim > Beautify codes with a simple vim trick

Beautify codes with a simple vim trick

For codes that are not properly indented, use the followings to correct them with vim:

1) select the parts that are not correctly indented, you can
    a) select codes line-by-line by pressing v, then the up or down arrow key
    b) select a whole block of codes by entering viB
    c) select the whole document by entering ggvG

2) Now press the equal sign = and smile

Advertisements
Categories: Tip, vim
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: