What is the recommended way to use Vim folding for Python code

后端 未结 11 1991
自闭症患者
自闭症患者 2020-12-22 16:33

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

11条回答
  •  隐瞒了意图╮
    2020-12-22 17:15

    Personally I can't convince myself to litter my code with the markers. I've become pretty used to (and efficient) at using indent-folding. Together with my mapping of space bar (see below) to open/close folds and the zR and zM commands, I'm right at home. Perfect for Python!

    set foldmethod=indent
    nnoremap  za
    vnoremap  zf
    

提交回复
热议问题