Edit Page
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 20: | Line 20: | ||
To [[Use folds in your program|use these folds]], put <code>setlocal foldmethod=syntax</code> in <code>after/ftplugin/vim.vim</code>. While you're at it, it also makes sense to avoid folding in the command window (<code>q:</code>). You can use the following fragment for that: |
To [[Use folds in your program|use these folds]], put <code>setlocal foldmethod=syntax</code> in <code>after/ftplugin/vim.vim</code>. While you're at it, it also makes sense to avoid folding in the command window (<code>q:</code>). You can use the following fragment for that: |
||
+ | <pre> |
||
β | <source lang='vim'> |
||
" Folding via syntax is used for this filetype. |
" Folding via syntax is used for this filetype. |
||
setlocal foldmethod=syntax |
setlocal foldmethod=syntax |
||
Line 36: | Line 36: | ||
setlocal foldcolumn=4 |
setlocal foldcolumn=4 |
||
endif |
endif |
||
β | </ |
+ | </pre> |
Alternatively, you can use an autocommand or a mapping to enable folding. If using an autocommand, the FileType and Syntax events are probably the best ones to use. Calling <code>zR</code> as well when you do this will [[All folds open when opening a file|start with all the folds open when loading the file]]. |
Alternatively, you can use an autocommand or a mapping to enable folding. If using an autocommand, the FileType and Syntax events are probably the best ones to use. Calling <code>zR</code> as well when you do this will [[All folds open when opening a file|start with all the folds open when loading the file]]. |