Emulates marker folds while using syntax foldmethod
MinPlug Jorengarenar/vim-syntaxMarkerFold
Plug 'Jorengarenar/vim-syntaxMarkerFold'
cd ~/.vim/pack/plugins/start
git clone git://github.com/Jorengarenar/vim-syntaxMarkerFold.git
You only need to install this plugin and have foldmethod
set to syntax
.
Markers should behave the way described in :h fold-marker
(except zf
and zd
mappings).
By default the max level of leveled marker (i.e. {{{1
, {{{2
, ...) is limited
to 5. If you wish to increase it, set g:syntaxMarkerFold_maxlevel
to desired
value (local to buffer b:syntaxMarkerFold_maxlevel
is also available).
Matching pairs markers are independent from this variable.
filetype plugin on " must be before `syntax enable`
syntax enable
set foldmethod=syntax