]> git.sev.monster Git - dotfiles.git/commitdiff
use xdg for vim config, add viminfo to xdg
authorsev <git@sev.monster>
Mon, 17 Jul 2023 08:28:42 +0000 (03:28 -0500)
committersev <git@sev.monster>
Fri, 5 Apr 2024 21:27:40 +0000 (16:27 -0500)
etc/vim/.vimrc

index f79a80bd7dcbc307dda94d92d0f4df94873c443f..3c96a4fc1233a98d061b63ad1d397f677c75cd74 100644 (file)
@@ -3,21 +3,24 @@ source $VIMRUNTIME/defaults.vim
 let x = ($XDG_CONFIG_HOME??($HOME."/.config"))."/vim"
 execute 'set runtimepath='.x.','.&runtimepath.','.x.'/after'
 execute 'set packpath='.x.','.&packpath.','.x.'/after'
-unlet x
 
 packadd matchit
 
-if !isdirectory($HOME . "/.local/share/vim")
-    call mkdir($HOME . "/.local/share/vim", "p", 0700)
+let x = ($XDG_DATA_HOME??($HOME."/.local/share"))."/vim"
+if !isdirectory(x)
+    call mkdir(x, "p", 0700)
 endif
 set backup
-set backupdir=$HOME/.local/share/vim//
+execute 'set backupdir='.x.'//'
 set backupcopy=yes
-if !isdirectory($HOME . "/.local/state/vim")
-    call mkdir($HOME . "/.local/state/vim", "p", 0700)
+let x = ($XDG_STATE_HOME??($HOME."/.local/state"))."/vim"
+if !isdirectory(x)
+    call mkdir(x, "p", 0700)
 endif
 set undofile
-set undodir=$HOME/.local/state/vim//
+execute 'set undodir='.x.'//'
+execute 'set viminfofile='.x.'/.viminfo'
+unlet x
 
 set autoindent
 set colorcolumn=80
This page took 0.032381 seconds and 4 git commands to generate.