feat(Vim): Group all Neovim's defaults in a separate module

Put together all the defaults brought from Neovim, in a separate runtime
file in Vim's config dir.
This commit is contained in:
Dionisio E Alonso 2024-04-04 23:07:56 -03:00
parent e3979594cb
commit 4da012f342
2 changed files with 16 additions and 4 deletions

15
vim/neovim.vim Normal file
View File

@ -0,0 +1,15 @@
" Some nice defaults from Neovim
set tabpagemax=50
if empty($XDG_STATE_HOME)
let $XDG_STATE_HOME = "~/.local/state"
endif
let g:stdpath_state = $XDG_STATE_HOME .. "/vim"
call mkdir(g:stdpath_state .. "/swap", "p", 0o700)
call mkdir(g:stdpath_state .. "/undo", "p", 0o700)
call mkdir(g:stdpath_state .. "/backup", "p", 0o700)
set directory^=$XDG_STATE_HOME/vim/swap//
set undodir^=$XDG_STATE_HOME/vim/undo
set backupdir^=$XDG_STATE_HOME/vim/backup

View File

@ -22,10 +22,7 @@ if has('autocmd')
endif
let &colorcolumn = join(range(80+1, 256), ',')
set directory^=~/.local/share/vim/swap//
set undodir^=~/.local/share/vim/undo
set backupdir^=~/.local/share/vim/backup
set tabpagemax=50 " This is Neovim's default
runtime! neovim.vim
set switchbuf+=usetab,newtab