From 6ceccd1ef32997625eecb6fd92ab77a8f4546cae Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sun, 3 May 2020 02:00:23 +1200 Subject: Separate cache runtime behaviour from config It's a little awkward to conflate them. --- vim/vimrc | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 3d5aef3a..04aebfd6 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -2,7 +2,7 @@ " Tom Ryder (tejr)’s Literate Vimrc " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ " -" Last updated: Wed, 29 Apr 2020 02:53:22 UTC +" Last updated: Sat, 02 May 2020 13:59:44 UTC " " │ And I was lifted up in heart, and thought " │ Of all my late-shown prowess in the lists, @@ -103,23 +103,26 @@ endif " We'll use the XDG directories as machine-local configuration and storage. " " -" Add all the configuration directories to 'runtimepath', and then put the -" cache home at the very front, so that e.g. 'spellfile' gets created in there -" rather than in the configuration directories. +" Add all the configuration directories to 'runtimepath'. " -let s:xdgruntimepaths = xdg#['config']['dirs'] +let s:xdgconfigpaths = xdg#['config']['dirs'] if xdg#['config']['home'] !=# '' - call insert(s:xdgruntimepaths, xdg#['config']['home']) + call insert(s:xdgconfigpaths, xdg#['config']['home']) endif -if xdg#['cache']['home'] !=# '' - call insert(s:xdgruntimepaths, xdg#['cache']['home']) -endif -for s:xdgruntimepath in reverse(s:xdgruntimepaths) +for s:xdgconfigpath in reverse(s:xdgconfigpaths) execute 'set runtimepath^=' - \.option#Escape(option#item#Escape(s:xdgruntimepath)) + \.option#Escape(option#item#Escape(s:xdgconfigpath)) endfor -unlet! s:xdgruntimepath -unlet s:xdgruntimepaths +unlet! s:xdgconfigpath +unlet s:xdgconfigpaths + +" Now put the XDG cache home at the very front, so that e.g. 'spellfile' gets +" created in there rather than in the configuration directories. +" +if xdg#['cache']['home'] !=# '' + execute 'set runtimepath^=' + \.option#Escape(option#item#Escape(xdg#['cache']['home'])) +endif " We need a command to reliably establish a full path, whether or not the " directories already exist. We create a wrapper for the autoloaded function -- cgit v1.2.3 ch'/>
path: root/bin/tl.sh