What is the recommended way to use Vim folding for

2019-03-07 21:31发布

I am interested in enabling code folding in Vim for Python code. I have noticed multiple ways to do so.

Does anyone have a preferred way to do Python code folding in Vim? I.e,

  • Do you have a particular Vim plugin that you use and like?
  • Do you use manual folding or do you place markers in comments?
  • Any other recommended ways to do code folding for Python in Vim?

9条回答
仙女界的扛把子
2楼-- · 2019-03-07 21:59

The Python source comes with a vim syntax plugin along with a custom vimrc file. Check the python FAQ on vim

查看更多
Viruses.
3楼-- · 2019-03-07 22:02

Yet another plugin for folding Python code. Rather simple, handling docstrings, and on the GitHub:

SimpylFold

Enjoy!

查看更多
我只想做你的唯一
4楼-- · 2019-03-07 22:03

I use this syntax file for Python. It sets the folding method to syntax and folds all classes and functions, but nothing else.

查看更多
登录 后发表回答