Posted on 2007-08-06 21:24
ZelluX 阅读(359)
评论(0) 编辑 收藏 所属分类:
Linux
1. The following Vim command will perform a fast code block formatting:
1G=G
We can split it up in simply says:
1G : Go to the first line(you can also use gg)
= : Indent according to the configuration
G : Go to the last line(tell Vim where to end indenting)
2. Another way is to go into visual mode with V and press = to reindent the chosen lines.
3.
=i{ will reindent everything between { and } excluding the brackets.
other similar choices:
a{ : all the code between { and } including the brackets.
i(, a(, i<, a<, i[, a[