diff options
author | Urbain Vaes <urbain@vaes.uk> | 2015-05-05 08:29:12 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2015-05-05 08:29:12 +0100 |
commit | b512cd2427ce23bcd36c8b0bbdc9fcb6f6047e93 (patch) | |
tree | 96d15ba7adc08f17af8fc2e730044df8aee9fb3f /vim | |
parent | a61859d05e64e0c26b938c398dfbe40bf4f1833c (diff) |
reorganised vimrc
Diffstat (limited to 'vim')
-rw-r--r-- | vim/after/ftplugin/vim/folding.vim | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/vim/after/ftplugin/vim/folding.vim b/vim/after/ftplugin/vim/folding.vim index 7f8f28d..1454cbe 100644 --- a/vim/after/ftplugin/vim/folding.vim +++ b/vim/after/ftplugin/vim/folding.vim @@ -1,25 +1,25 @@ -" function! VimFolds() -" let thisline = getline(v:lnum) -" if match(thisline,'^"" ') >= 0 -" return ">1" -" elseif match(thisline,'^" ') >=0 -" return ">1" -" else -" return "=" -" endif -" endfunction -" -" function! VimFoldText() -" let startline = getline(v:foldstart) -" if match(startline,'^"" ') >= 0 -" let title = substitute(startline,'^"" \(.*\)$','\1',"") -" return '# ' . title -" elseif match(startline,'^" ') >=0 -" let title = substitute(startline,'^" \(.*\)$','\1',"") -" return ' ## ' .title -" endif -" endfunction -" -" setlocal foldmethod=expr -" setlocal foldexpr=VimFolds() -" setlocal foldtext=VimFoldText() +function! VimFolds() + let thisline = getline(v:lnum) + if match(thisline,'^"" ') >= 0 + return ">1" + elseif match(thisline,'^" ') >=0 + return ">1" + else + return "=" + endif +endfunction + +function! VimFoldText() + let startline = getline(v:foldstart) + if match(startline,'^"" ') >= 0 + let title = substitute(startline,'^"" \(.*\)$','\1',"") + return '# ' . title + elseif match(startline,'^" ') >=0 + let title = substitute(startline,'^" \(.*\)$','\1',"") + return ' ## ' .title + endif +endfunction + +setlocal foldmethod=expr +setlocal foldexpr=VimFolds() +setlocal foldtext=VimFoldText() |