From 4850f4c28bd13b74c18979652de1c4b850cdc86f Mon Sep 17 00:00:00 2001 From: sev Date: Mon, 17 Jul 2023 03:28:42 -0500 Subject: [PATCH] use xdg for vim config, add viminfo to xdg --- etc/vim/.vimrc | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/etc/vim/.vimrc b/etc/vim/.vimrc index f79a80b..3c96a4f 100644 --- a/etc/vim/.vimrc +++ b/etc/vim/.vimrc @@ -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 -- 2.47.0