The code folding of vim, reading the code folding of vim, vim also has the code folding function. it was previously known that, after all, it is rarely used, and this function is rarely used. With the recent close contact with gvim, the code folding feature has become increasingly familiar. One time I opened a piece of php code, such as PEAR. php, and found that the code in it was automatically folded, replacing "> <LINKhref =" http: // www.
Vim also has the code folding function. it was previously known that, after all, it is rarely used. With the recent close contact with gvim, the code folding feature has become increasingly familiar. Once I opened a piece of php code, such as PEAR. php, the code in it is automatically folded. after the code is expanded, you can see that as long as there are/* {*/and/*} */on both sides of the code /*}}}*/, it is automatically folded. Search for configuration carefully. one of the following statements is important:
Foldmethod = marker
In this way, vim will automatically search for the code, fold the content between {and}, and a small comment at the end of the code is not useless:
/*
* Local Variables:
* Mode: php
* Tab-width: 4
* C-basic-offset: 4
* End:
*/
This annotation will be read by vim and automatically set to the environment variable.
For code folding usage, enter the following in vim:
: Help zo
You can see a lot of related shortcut keys, you need some exercises to be handy :)
My gvim configuration content has been added:
Colo zellner
Set guifont = Courier_New: h11: cANSI nobackup tabstop = 4 shiftwidth = 4 foldmethod = marker
Au BufRead * simalt ~ X
Minor vim-related discoveries:
In the previous article of google reader, the next shortcut key is j, k, which is consistent with the vim cursor moving key. I don't know whether it is a coincidence or intentional one. if it is the latter, so google reader developers must also be fans of vim :)
When you use firefox to view the webpage source code, click "/" to display the search box, which is consistent with the vim search. it is estimated that firefox developers are also vim fans: p
Http://www.ooso.net/index.php/archives/183