diff --git a/programs/nvim/init.vim b/programs/nvim/init.vim index 4fd119e..406577e 100644 --- a/programs/nvim/init.vim +++ b/programs/nvim/init.vim @@ -35,13 +35,6 @@ aug filetype_md aug END " }}} -" Vimscript file settings {{{ -aug filetype_vim - au! - au FileType vim setlocal foldmethod=marker foldcolumn=1 foldlevelstart=0 -aug END -" }}} - " Plugins {{{ call plug#begin() Plug 'junegunn/seoul256.vim' " theme diff --git a/programs/nvim/plugins/base-fold-opt.vim b/programs/nvim/plugins/base-fold-opt.vim new file mode 100644 index 0000000..0e95f52 --- /dev/null +++ b/programs/nvim/plugins/base-fold-opt.vim @@ -0,0 +1,22 @@ +aug config_fold + au! + au FileType * call ConfigFold() +aug END + +function! s:ConfigFold() + let l:ft = &g:filetype + + if l:ft ==# 'vim' + call SetlFold('marker', 0) + elseif l:ft ==# 'markdown' + return + else + call SetlFold('syntax', 99) + endif +endfunction + +function! s:SetlFold(method, lvl) + let &foldmethod = a:method + let &foldlevel = a:lvl + let &foldcolumn = 1 +endfunction