Vim Tips Wiki

Changes: Wrap visual selection with fold markers


Back to page

(Move categories to tip template)
(Remove html character entities)
Line 16: Line 16:
vmap &lt;leader&gt;fold mz:&lt;esc&gt;'&lt;O// <nowiki>{{{</nowiki>&lt;esc&gt;'&gt;o// <nowiki>}}}</nowiki>&lt;esc&gt;`z?<nowiki>{{{</nowiki>&lt;cr&gt;A&lt;space&gt;
vmap <Leader>fold mz:<Esc>'<O// <nowiki>{{{</nowiki><Esc>'>o// <nowiki>}}}</nowiki><Esc>`z?<nowiki>{{{</nowiki><CR>A<Space>

Latest revision as of 08:46, September 29, 2008

This tip is deprecated for the following reasons:

As the comment below indicates, you can use the "zf" command.

Tip 475 Printable Monobook Previous Next

created May 18, 2003 · complexity basic · author culley · version 6.0

Use this vmap to enclose a block with fold markers:

vmap <Leader>fold mz:<Esc>'<O// {{{<Esc>'>o// }}}<Esc>`z?{{{<CR>A<Space>


Prefer the zf command, in combination with foldmethod=marker. See :help zf.

Around Wikia's network

Random Wiki