diff options
author | Urbain Vaes <urbain@vaes.uk> | 2015-05-18 15:05:59 +0100 |
---|---|---|
committer | Urbain Vaes <urbain@vaes.uk> | 2015-05-18 15:05:59 +0100 |
commit | d2d3900ea28d1bd2a86238e9c16d142d07ec7e45 (patch) | |
tree | a7aeef2a9cca2de8be3e77c3116d4b332a088ef7 /nvim/after/ftplugin/vim/folding.vim | |
parent | 96f53af4ab7b853034c4570ba7f21e2bac10dcbf (diff) |
added .nvim with configuration
Diffstat (limited to 'nvim/after/ftplugin/vim/folding.vim')
-rw-r--r-- | nvim/after/ftplugin/vim/folding.vim | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/nvim/after/ftplugin/vim/folding.vim b/nvim/after/ftplugin/vim/folding.vim new file mode 100644 index 0000000..1454cbe --- /dev/null +++ b/nvim/after/ftplugin/vim/folding.vim @@ -0,0 +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() |