Fandom

Vim Tips Wiki

Wrap visual selection with fold markers

1,624pages on
this wiki
Add New Page
Talk0 Share

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>

CommentsEdit

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


Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.