sponsor Vim development Vim logo Vim Book Ad

basic Tip #475: wrap visual selection with fold markers

 tip karma   Rating 3/4, Viewed by 1381 

Read and edit this tip on the Vim tip wiki. The wiki may have a more recent version of this tip.

created:   May 18, 2003 6:46      complexity:   basic
author:   culley      as of Vim:   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>

 rate this tip  Life Changing Helpful Unfulfilling 

<< have . restore the cursor position a la emacs in viper mode | multime errorformat & makeprgs >>

Additional Notes

Kartik Agaram, May 18, 2003 12:08
Prefer the zf command, in combination with foldmethod=marker.

:help zf
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Sponsored by Web Concept Group Inc. SourceForge.net Logo