Created
January 9, 2015 14:34
-
-
Save suy/642578f174d03499fa3d to your computer and use it in GitHub Desktop.
This file contains 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
augroup FoldComments | |
autocmd! | |
autocmd BufReadPost * :call s:Fold() | |
augroup END | |
function! s:Fold() abort | |
let starting_position = getcurpos() | |
keepjumps normal! gg | |
" TODO: be smart and only fold if the comment has copyright info. | |
if hlID("Comment") == synIDtrans(synID(1,1,0)) | |
silent! normal! zc | |
endif | |
call setpos('.', starting_position) | |
endfunction |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment