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>
<< 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
|
|