vim: keep nvim default path & point vim to the same paths, improvment on 28f07567

parent a70d3af6
......@@ -195,7 +195,9 @@ if has('nvim')
endif
if has('mksession')
let &viewdir=$XDG_DATA_HOME.'/vim/view' " override ~/.vim/view default
if !has('nvim')
let &viewdir=$XDG_DATA_HOME.'/nvim/view' " override ~/.vim/view default
endif
set viewoptions=cursor,folds " save/restore just these (with `:{mk,load}view`)
endif
......@@ -203,14 +205,18 @@ if exists('$SUDO_USER')
set nobackup " don't create root-owned files
set nowritebackup " don't create root-owned files
else
let &backupdir=$XDG_DATA_HOME.'/vim/backup' " keep backup files out of the way
if !has('nvim')
let &backupdir=$XDG_DATA_HOME.'/nvim/backup' " keep backup files out of the way
endif
set backupdir+=.
endif
if exists('$SUDO_USER')
set noswapfile " don't create root-owned files
else
let &directory=$XDG_DATA_HOME.'/vim/swap//' " keep swap files out of the way
if !has('nvim')
let &directory=$XDG_DATA_HOME.'/nvim/swap//' " keep swap files out of the way
endif
set directory+=.
endif
......@@ -224,7 +230,9 @@ if has('persistent_undo')
if exists('$SUDO_USER')
set noundofile " don't create root-owned files
else
let &undodir=$XDG_DATA_HOME.'/vim/undo/' " keep undo files out of the way
if !has('nvim')
let &undodir=$XDG_DATA_HOME.'/nvim/undo/' " keep undo files out of the way
endif
set undodir+=.
set undofile " actually use undo files
endif
......@@ -239,13 +247,13 @@ if exists('$SUDO_USER') " don't create root-owned files
else
if has('nvim')
" default in nvim: !,'100,<50,s10,h
execute "set shada=!,'100,<500,:10000,/10000,s10,h,n".$XDG_DATA_HOME.'/vim/main.shada'
set shada=!,'100,<500,:10000,/10000,s10,h
augroup MyNeovimShada
autocmd!
autocmd CursorHold,FocusGained,FocusLost * rshada|wshada
augroup END
else
execute "set viminfo=!,'100,<500,:10000,/10000,s10,h,n".$XDG_DATA_HOME.'/vim/viminfo'
execute "set viminfo=!,'100,<500,:10000,/10000,s10,h,n".$XDG_DATA_HOME.'/nvim/viminfo'
endif
endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment