Add default folding settings

This commit is contained in:
ItsDrike 2021-09-25 02:42:36 +02:00
parent cf79be3216
commit ddc758b6e1
No known key found for this signature in database
GPG key ID: FB8CA11A2CF3A843
2 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,13 @@ set path+=** " Search down into subfolders with tab completio
set wildmode=longest,list,full " Enable autocompletion set wildmode=longest,list,full " Enable autocompletion
set wildmenu " Display all matching files when we tab complete set wildmenu " Display all matching files when we tab complete
" Folding
set foldmethod=indent " Use indent to determine the fold levels
set foldnestmax=8 " Only fold up to given amount of levels
set foldlevel=2 " Set initial fold level
set nofoldenable " Hide all folds by default
" Misc " Misc
set autoindent " Enable autoindent set autoindent " Enable autoindent
set autoread " Reload files on change set autoread " Reload files on change

View file

@ -14,6 +14,10 @@ vnoremap <C-v> "+p
" Start spell-check " Start spell-check
map <leader>s :setlocal spell! spelllang=en_us<CR> map <leader>s :setlocal spell! spelllang=en_us<CR>
" Use space for folding/unfolding sections
nnoremap <space> za
vnoremap <space> zf
" Use shift to move 10 lines up/down quickly " Use shift to move 10 lines up/down quickly
noremap <silent> K 10k noremap <silent> K 10k
noremap <silent> J 10j noremap <silent> J 10j
@ -58,3 +62,4 @@ nnoremap <A-c> :w \| !comp <c-r>%<CR>
" Shell check " Shell check
nnoremap <leader>p :!shellcheck %<CR> nnoremap <leader>p :!shellcheck %<CR>