I added set foldmethod=syntax to my .vimrc, but it automatically folds whenever a new file is opened. Is there a way to prevent auto-folding and just use za to toggle?
Asked
Active
Viewed 4,085 times
5
ogirginc
- 345
- 3
- 11
-
Thanks @grodzik your link solved my problem! However, not sure about the duplication. Should I delete this one or keep it? – ogirginc May 07 '17 at 19:10
1 Answers
2
As it turns out, I need nofoldenable in .vimrc too:
set foldmethod=syntax
set nofoldenable
ogirginc
- 345
- 3
- 11
-
1
-
2@Antony do you suggest using
set foldlevelstart=99? Does it make any difference compared tonofoldenable? Couldn't find any advantages... – ogirginc May 08 '17 at 07:41 -
It's a global option that specifies the starting
'foldlevel'when editing a new file.'foldenable'is window local and toggles folds on or off.. You can of course use both and toggle'foldenable'withzi. – Antony May 08 '17 at 10:47