Õâ¸ö½â¾öÁËÎÒ2¸öÎÊÌâ ÔÚ×¢ÊÍÐлسµ»ò²åÈëµ½ÏÂÒ»ÐÐʱ Ò²ÊÇ×¢Ê굀 Õâ¸öÎÊÌâÕÒÁ˺ܾÃûŪºÃ ûÏ뵽ŪÁËÕâ¸öºó¾ÍºÃÁË ÕæÊÇÈËÆ·´ó´óµÄºÃ°¡£¡£¡£¡£¡
ÔÎÄÁ´½Ó http://linux.172baby.com/posts/125843.html
Ëæ±Ê linuxman ·¢±íÓÚ2004-12-28 00:21
Õ³Ìùµ½vimµÄ´úÂ룬ÓÈÆäÊÇ´ÓWEBÕ³Ìù¹ýÀ´µÄ´úÂ룬¾³£ÊÇһƬ»ìÂÒ£¬¿´ÆðÀ´ÏòÓÒ²»¶ÏËõ½øÔì³ÉµÄ¡£
½â¾öµÄ°ì·¨ÊÇ£º
1 Õ³ÌùÍê±ÏʹÓÃÃüÁ
gg=G
ÉÏÃæÕâ¸öÃüÁîµÄÒâÒåÊÇ£¨Õª×Ôhttp://vimdoc.sourceforge.net/cgi-bin/vimfaq2html3.pl£©£º
14.6. How do I format/indent an entire file?
You can format/indent an entire file using the gg=G command, where
gg - Goto the beginning of the file
= - apply indentation
G - till end of file
For more information, read
:help gg
:help =
:help G
:help ''formatprg''
:help C-indenting
2 Ò»°ãµÄvim¶¼Ä¬ÈÏÉèÖÃΪset nopaste¡£ÔÚÕ³ÌùÇ°ÉèÖãº
set pasteʹµÃvim½øÈëÕ³Ìùģʽ£¬ÔòÕ³Ìù¹ýÀ´µÄÄÚÈÝÄܹ»±£³ÖÔÀ´µÄ¸ñʽ¡£
ÍƼöʹÓ÷½·¨2¡£