]> git.sev.monster Git - dotfiles.git/commitdiff
vimrc: use XDG_STATE_HOME subdirs for all files
authorsev <git@sev.monster>
Tue, 7 Nov 2023 15:08:13 +0000 (09:08 -0600)
committersev <git@sev.monster>
Fri, 5 Apr 2024 21:27:41 +0000 (16:27 -0500)
etc/vim/.vimrc

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