Last active
March 20, 2017 04:31
-
-
Save manasthakur/cda8d52ed0ab11aa2b43d19be0e8b2d0 to your computer and use it in GitHub Desktop.
Revisions
-
manasthakur revised this gist
Mar 20, 2017 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ function! MyFoldLevel(lnum) let cur_line = getline(a:lnum) @@ -30,5 +29,4 @@ function! MyFoldLevel(lnum) endif return '=' endfunction -
manasthakur revised this gist
Mar 20, 2017 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,14 +2,17 @@ function! MyFoldLevel(lnum) let cur_line = getline(a:lnum) " Fold sections at level 1 if cur_line =~ '^\s*\\section' return '>1' endif " Fold subsections at level 2 if cur_line =~ '^\s*\\subsection' return '>2' endif " Fold subsubsections at level 3 if cur_line =~ '^\s*\\subsubsection' return '>3' endif -
manasthakur created this gist
Mar 20, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ ```vim function! MyFoldLevel(lnum) let cur_line = getline(a:lnum) if cur_line =~ '^\s*\\section' return '>1' endif if cur_line =~ '^\s*\\subsection' return '>2' endif if cur_line =~ '^\s*\\subsubsection' return '>3' endif " Fold following environments let fold_envs = ['figure', 'algorithm', 'frame'] let envs = '\(' . join(fold_envs, '\|') . '\)' if cur_line =~ '^\s*\\begin{' . envs return 'a1' endif if cur_line =~ '^\s*\\end{' . envs return 's1' endif return '=' endfunction ```