From d2d3900ea28d1bd2a86238e9c16d142d07ec7e45 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Mon, 18 May 2015 15:05:59 +0100 Subject: added .nvim with configuration --- nvim/after/ftplugin/vim/folding.vim | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 nvim/after/ftplugin/vim/folding.vim (limited to 'nvim/after/ftplugin/vim') 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() -- cgit v1.2.3