Confusion about vim folding - how to disable?

后端 未结 9 1293
暗喜
暗喜 2020-12-22 20:20
  1. When I open the file it looks like this: \"enter or even this
9条回答
  •  生来不讨喜
    2020-12-22 21:09

    Here is an article which briefly and concisely sums up why folding is cool. The one line reason is that folding makes navigating very large files a breeze.

    If you want to leave folding enabled, and simply always start with all folds open, the vim wiki tells how. The method of interest to you would probably be the autocommand method.

    " Tweak the event and filetypes matched to your liking. 
    " Note, perl automatically sets foldmethod in the syntax file
    autocmd Syntax c,cpp,vim,xml,html,xhtml setlocal foldmethod=syntax
    autocmd Syntax c,cpp,vim,xml,html,xhtml,perl normal zR
    

    I would also recommend searching for custom folding methods for the language you use. Simply googling "vim folding" should bring up a number of options. Play around with the different options until you find a folding method you like.

提交回复
热议问题