vibol hou

Code folding in VIM 6.0+

Here’s a neat little feature I’ve just been introduced to. After coding in VIM for so many years, one might think I’d know these things, but as it turns out, there’s a lot of features in VIM I’m not using. This one, however, will likely be a time-saver. There are a number of different code folding methods available in VIM (:help folding). I use the marker method by including this in my .vimrc file:

set foldmethod=marker

I can then use the following commands from command mode (not colon mode):

More commands are available in :help folding.


2 Comments

Hi,
Any idea how you can get the highlight a particular pattern throughout the text when you search for it?

Posted by Aashish Dattani on 25 June 2007 @ 11pm

There is a VIM set commmand:

set hlsearch

Which should turn on search pattern highlighting. Place that in your .vimrc file to turn it on permanently.

Posted by Vibol on 26 June 2007 @ 1pm

Leave a Comment


The Huntington LibrarySan PedroLong Beach Cambodian New Year Parade 2008CSULB Cambodian Student Society Culture Show 2008Ventura PierWeekend Project: NemesisSan FranciscoIchiPaintball 6/27/2009