pseewald / vim-anyfold

Language agnostic vim plugin for folding and motion based on indentation.
MIT License
268 stars 11 forks source link

Folding Import/include statements #18

Closed nirajgup closed 6 years ago

nirajgup commented 6 years ago

vim-anyfold doesn't fold import/include statements currently.

We should fold #import/#include statements for java, cpp, c, python etc. Most major IDEs currently do this.

pseewald commented 6 years ago

This is supported by vim-anyfold but not enabled by default. For java, cpp, c, python, the following configuration should work:

autocmd filetype java,cpp,c,python let b:anyfold_activate=1
autocmd filetype cpp,c let g:anyfold_identify_comments=1
autocmd filetype python,java let g:anyfold_identify_comments=2
let g:anyfold_fold_comments=1
let g:anyfold_comments=['comment','string','external','include']
nirajgup commented 6 years ago

Thanks!

The suggested configuration works. I will close the issue.