refac(prog/nvim): enable folding for rust,js,ts
This commit is contained in:
parent
6a4888e3f5
commit
8af8221825
2 changed files with 22 additions and 7 deletions
|
@ -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
|
||||
|
|
22
programs/nvim/plugins/base-fold-opt.vim
Normal file
22
programs/nvim/plugins/base-fold-opt.vim
Normal file
|
@ -0,0 +1,22 @@
|
|||
aug config_fold
|
||||
au!
|
||||
au FileType * call <SID>ConfigFold()
|
||||
aug END
|
||||
|
||||
function! s:ConfigFold()
|
||||
let l:ft = &g:filetype
|
||||
|
||||
if l:ft ==# 'vim'
|
||||
call <SID>SetlFold('marker', 0)
|
||||
elseif l:ft ==# 'markdown'
|
||||
return
|
||||
else
|
||||
call <SID>SetlFold('syntax', 99)
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:SetlFold(method, lvl)
|
||||
let &foldmethod = a:method
|
||||
let &foldlevel = a:lvl
|
||||
let &foldcolumn = 1
|
||||
endfunction
|
Loading…
Reference in a new issue