vim-indent-folding

indentation based folding for vim
git clone https://git.ce9e.org/vim-indent-folding.git

commit
470bcc7422190a396a97f488d5d9b3748157e462
parent
a51649cea4d99f223c501612702428fee87dcfc5
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2013-12-01 00:04
tiny bit more doc

Diffstat

M after/plugin/folding.vim 5 +++--

1 files changed, 3 insertions, 2 deletions


diff --git a/after/plugin/folding.vim b/after/plugin/folding.vim

@@ -1,7 +1,7 @@
    1     1 set foldlevel=99
    2     2 
    3     3 function! IndentLevel(lnum)
    4    -1 	return indent(a:lnum) / &shiftwidth
   -1     4 	return indent(a:lnum) / &tabstop
    5     5 endfunction
    6     6 
    7     7 function! NextNonBlankLine(lnum)
@@ -35,12 +35,13 @@ function! Fold(lnum)
   35    35 	endif
   36    36 endfunction
   37    37 
   -1    38 " display first line with correct indentation
   38    39 function! FoldText()
   39    40 	let firstline = getline(v:foldstart)
   40    41 	if &expandtab
   41    42 		let space = ''
   42    43 	else
   43    -1 		let space = repeat(' ', indent(v:foldstart) - IndentLevel(v:foldstart) )
   -1    44 		let space = repeat(' ', indent(v:foldstart) - indent(v:foldstart) / &tabstop)
   44    45 	endif
   45    46 	return space . firstline
   46    47 endfunction