Is there any way or tools to fold function in vim, like Visual Studio or Eclipse?
相关问题
- Emacs shell: save commit message
- How to change the first two uppercase characters o
- Insert text into current buffer from function
- Hot reload on save
- Substituting zero-width match in vim script
相关文章
- 如何让 vim 支持 .cshtml 文件的代码高亮
- Auto-save in VIM as you type
- How can I use gcc's -I command to add recursiv
- Vim: overloaded mapping for multiple modes
- How to use relative line numbering universally in
- How to copy the value of a vim option to a registe
- E185: Cannot find color scheme*
- How do I fix vim to properly indent folds containi
yes, it is bound to the 'z' key, e.g. zO opens all folds. see ":help fold" in vim for more information. You can do folding according to very simple rules, like indentation, or according to the code syntax.
should fold all functions and other blocks automatically, if you have syntax file for your language.
Yes. VIM has exceptional folding capabilities. I don't like learning too many controls, I prefer automation, so here is what I personally use:
In my .vimrc:
This automatically folds files that you open, based on indent, for everything indented for more than 1 level. The foldclose option makes the fold automatically re-close after I navigate out of the fold.
In-file Controls:
And if you ever get annoyed with the folds, use
or press:
to make them all go away.
Source: vim docs.
Vim has excellent folding support. There is good documentation in the vim help system. Just open vim and do
After reading that you can also read
for some more information.