refac(prog/nvim): enable folding for rust,js,ts

This commit is contained in:
Dmitriy Pleshevskiy 2022-04-04 00:17:46 +03:00
parent 6a4888e3f5
commit 8af8221825
2 changed files with 22 additions and 7 deletions

View file

@ -35,13 +35,6 @@ aug filetype_md
aug END aug END
" }}} " }}}
" Vimscript file settings {{{
aug filetype_vim
au!
au FileType vim setlocal foldmethod=marker foldcolumn=1 foldlevelstart=0
aug END
" }}}
" Plugins {{{ " Plugins {{{
call plug#begin() call plug#begin()
Plug 'junegunn/seoul256.vim' " theme Plug 'junegunn/seoul256.vim' " theme

View 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