How do I enable automatic folds in Vim?

后端 未结 4 617
逝去的感伤
逝去的感伤 2020-12-07 07:52

How do I enable automatic folding in Vim? set foldmethod=syntax doesn\'t seem to do much of anything.

4条回答
  •  盖世英雄少女心
    2020-12-07 08:27

    The way to enable folding in new versions of Vim has changed (I'm using vim 7.4). Now you should create the file ~/.vim/ftplugin/javascript.vim (on linux) and add your code folding instructions as explained in Eric Johnson's answer. File type detection and loading plugins for specific file types must be enabled by putting this into your .vimrc:

    filetype plugin on
    

提交回复
热议问题