Wikia

Vim Tips Wiki

Changes: Fold away empty lines

Edit

Back to page

(Change <tt> to <code>, perhaps also minor tweak.)
(Comments)
 
Line 27: Line 27:
   
 
==Comments==
 
==Comments==
  +
  +
Thanks for the tip, it works indeed, but appears to be very slow. Hundreds of empty lines have been added on a file I must look at, but it takes 30s before I can view the result -any idea ?
  +
  +
Regards,
  +
  +
Greg

Latest revision as of 15:41, September 23, 2013

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

Thanks for the tip, it works indeed, but appears to be very slow. Hundreds of empty lines have been added on a file I must look at, but it takes 30s before I can view the result -any idea ?

Regards,

Greg

Around Wikia's network

Random Wiki