Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let b:fold_levels = {}
- function! JST_Folds(lnum)
- let line = getline(a:lnum)
- if line =~ '^describe'
- return '0'
- elseif line =~ '^\s\+\(describe\|it\)'
- let lead = matchstr(line, '^\s\+')
- let b:fold_levels[lead] = lead
- return 'a1'
- elseif line =~ '^\s\+}\s*)\s*;'
- let lead = matchstr(line, '^\s\+')
- if has_key(b:fold_levels, lead)
- call remove(b:fold_levels, lead)
- return 's1'
- else
- return '='
- endif
- else
- return '='
- endif
- endfunction
- set fdm=expr
- set fde=JST_Folds(v:lnum)
Advertisement
Add Comment
Please, Sign In to add comment