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?
-
Thanks @grodzik your link solved my problem! However, not sure about the duplication. 🤔 Should I delete this one or keep it?– ogirgincMay 7, 2017 at 19:10
1 Answer
As it turns out, I need nofoldenable
in .vimrc
too:
set foldmethod=syntax
set nofoldenable
-
1
-
2@Antony do you suggest using
set foldlevelstart=99
? Does it make any difference compared tonofoldenable
? Couldn't find any advantages...– ogirgincMay 8, 2017 at 7: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
.– AntonyMay 8, 2017 at 10:47