Wikia

Vim Tips Wiki

Fold away empty lines

Talk0
1,599pages on
this wiki

Redirected from VimTip399

Tip 399 Printable Monobook Previous Next

created 2003 · complexity basic · author Thomas · version 6.0


You can fold sequences of two or more empty lines (may contain whitespace) with these settings:

:syn match MyEmptyLines "\(^\s*\n\)\+" fold
:syn sync fromstart
:setlocal foldmethod=syntax

After entering the above, type zM to close all folds, or zR to open them.

If you have set 'foldcolumn' to more than 0 you can open/close the empty-line blocks by clicking the '+' or '-' with the mouse in the folder column.

See alsoEdit

CommentsEdit

Advertisement | Your ad here

Photos

Add a Photo
103photos on this wiki
See all photos >

Recent Wiki Activity

See more >

Around Wikia's network

Random Wiki