mhinz / vim-galore

:mortar_board: All things Vim!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add plugin SimpylFold for folding of python code

kiryph opened this issue · comments

IMHO SimpylFold is a better plugin for folding of python code than the listed plugin braceless.vim.

Could you add SimpylFold to the section for the filetype python? Currently, this plugin has 288 stars on github.

- [SimpylFold](https://github.com/tmhedberg/SimpylFold)

I have tried braceless.vim for folding of python code. However, it has some quirks and bugs. On the positive side: the performance is really good due to the way the plugin generates folds.

  • When opening a python file, braceless.vim will not define any folds on open. Therefore commands such as zm, zM, zr, and zR do not work immediately. This is documented in braceless.vim and is intended

    Keystrokes such as |zM| and |zR| will only work on folds you have previously closed.

    You have to fold all root folds manually to activate folds!

  • Incorrect fold levels are defined when closing all root folds in following circumstance:
    screen shot 2018-03-04 at 17 00 49

    The maximal foldlevel should be 3. This might be a bug and can possibly be fixed. Currently, this makes commands zm and zr not really useful.

  • Foldtext for methods with a decorator show only the decorator, not the name of the method, which is not what I want:
    screen shot 2018-03-04 at 17 05 24

    Someone who uses this plugin could probably raise a feature request for braceless.vim.

  • Another thing I like about SimpylFold that it does not fold if-blocks which I think is a good choice. braceless.vim cannot be configured to do this as well.

You make some very good points. I'll add it.

Thanks!