Created
October 6, 2011 22:40
-
-
Save mattsacks/1268918 to your computer and use it in GitHub Desktop.
Easy way to make a fold with {{{,}}} markers in vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" create a new fold with {{{ }}} markers | |
function! s:Fold(fold) | |
let beg = substitute(&commentstring, '%s', a:fold, '') | |
let end = substitute(&commentstring, '%s', 'END '.a:fold, '') | |
call setline('.', beg.' {{{') | |
call append('.', end.' }}}') | |
endfunction | |
command! -nargs=1 Fold :call s:Fold(<f-args>) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment