bairui

JS Test Foldexpr

Jan 19th, 2012
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 0.29 KB | None | 0 0
  1. function! JST_Folds(lnum)
  2.   let line = getline(a:lnum)
  3.   if line =~ '^describe'
  4.     return '>1'
  5.   elseif line =~ '^\s\+\(describe\|it\)'
  6.     return 'a1'
  7.   elseif line =~ '^\s*}\s*)\s*;'
  8.     return 's1'
  9.   else
  10.     return '='
  11.   endif
  12. endfunction
  13.  
  14. set fdm=expr
  15. set fde=JST_Folds(v:lnum)
Advertisement
Add Comment
Please, Sign In to add comment