Skip to content

Instantly share code, notes, and snippets.

View mogelbrod's full-sized avatar

Victor Hallberg mogelbrod

View GitHub Profile
@mogelbrod
mogelbrod / gist:4266297
Created December 12, 2012 09:13
Vim fold function which does indentation based folding.
function! IndentationFoldExpr(ln) " {{{
let line = getline(a:ln)
if line =~ '^\s*$'
return '-1' "'='
end
let ind = indent(a:ln) / &sw
let ind_next = indent(nextnonblank(a:ln+1)) / &sw