Created
October 17, 2019 13:40
-
-
Save mhinz/9ec029b4e8ea7ac655b77f09577f9158 to your computer and use it in GitHub Desktop.
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 characters
function! g:FoldLispTopForm(lnum) | |
let curr = getline(a:lnum) | |
let next = getline(a:lnum+1) | |
if next[0] == '(' | |
return 0 | |
elseif curr[0] == '(' | |
return 1 | |
endif | |
return '=' | |
endfunction | |
autocmd FileType clojure,lisp,scheme setlocal foldmethod=expr foldexpr=g:FoldLispTopForm(v:lnum) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment