aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-11-19 20:59:07 +1300
committerTom Ryder <tom@sanctum.geek.nz>2020-11-19 20:59:07 +1300
commit23169b1a93d69637ad44d53996f07a623705801b (patch)
tree8d138d7f8075bc558abe1f0e0bbb79a26bd285ef
parentMerge branch 'release/v10.19.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-23169b1a93d69637ad44d53996f07a623705801b.tar.gz
dotfiles-23169b1a93d69637ad44d53996f07a623705801b.zip
Merge branch 'release/v10.20.0'v10.20.0
* release/v10.20.0: Don't set XDG vars if not running under Unix
-rw-r--r--VERSION4
-rw-r--r--vim/vimrc43
2 files changed, 26 insertions, 21 deletions
diff --git a/VERSION b/VERSION
index f0c6be0f..1dc5277c 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v10.19.0
-Thu, 19 Nov 2020 01:47:23 +0000
+tejr dotfiles v10.20.0
+Thu, 19 Nov 2020 07:59:04 +0000
diff --git a/vim/vimrc b/vim/vimrc
index 425a1d5b..0424fca2 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -2,7 +2,7 @@
" Tom Ryder (tejr)’s Literate Vimrc
" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"
-" Last updated: Fri, 23 Oct 2020 08:28:38 UTC
+" Last updated: Thu, 19 Nov 2020 07:55:42 UTC
"
" │ And I was lifted up in heart, and thought
" │ Of all my late-shown prowess in the lists,
@@ -137,16 +137,18 @@ let $MYVIM = option#Split(&runtimepath)[0]
" both the XDG_CONFIG_HOME and XDG_CONFIG_DIRS variables, or from their
" defaults, using autoloaded xdg# functions.
"
-let s:xdgcachehome
- \ = xdg#CacheHome()
-let s:xdgconfigdirs
- \ = xdg#ConfigDirs()
-let s:xdgconfighome
- \ = xdg#ConfigHome()
-let s:xdgdatadirs
- \ = xdg#DataDirs()
-let s:xdgdatahome
- \ = xdg#DataHome()
+if has('unix')
+ let s:xdgcachehome
+ \ = xdg#CacheHome()
+ let s:xdgconfigdirs
+ \ = xdg#ConfigDirs()
+ let s:xdgconfighome
+ \ = xdg#ConfigHome()
+ let s:xdgdatadirs
+ \ = xdg#DataDirs()
+ let s:xdgdatahome
+ \ = xdg#DataHome()
+endif
" We put XDG_CONFIG_HOME at the front of the 'runtimepath' list with insert(),
" provided it isn't empty, which is what the function returns when the
@@ -161,7 +163,8 @@ let s:xdgdatahome
"
" Ours not to reason why…
"
-if s:xdgconfighome !=# '' || !empty(s:xdgconfigdirs)
+if exists('s:xdgconfighome') && s:xdgconfighome !=# ''
+ \ || exists('s:xdgconfigdirs') && !empty(s:xdgconfigdirs)
execute 'set runtimepath^='.option#Escape(join(map(
\ extend(
\ s:xdgconfighome !=# '' ? [s:xdgconfighome] : [],
@@ -188,7 +191,7 @@ endif
" v8.1.716 introduced a way to set this with an option named 'viminfofile',
" but I don't see a reason to use that.
"
-if s:xdgcachehome !=# ''
+if exists('s:xdgcachehome') && s:xdgcachehome !=# ''
if !isdirectory(s:xdgcachehome)
call mkdir(s:xdgcachehome, 'p', 0700)
endif
@@ -238,7 +241,7 @@ set history=300
" 'backupfullname', 'swapfilefullname' would have been clearer.
"
set backup
-if s:xdgcachehome !=# ''
+if exists('s:xdgcachehome') && s:xdgcachehome !=# ''
if !isdirectory(s:xdgcachehome.'/backup')
call mkdir(s:xdgcachehome.'/backup', 'p', 0700)
endif
@@ -299,7 +302,7 @@ endif
" its name, in order to avoid filename collisions, since the 'directory'
" option has supported that hint for much longer than 'backupdir' has.
"
-if s:xdgcachehome !=# ''
+if exists('s:xdgcachehome') && s:xdgcachehome !=# ''
if !isdirectory(s:xdgcachehome.'/swap')
call mkdir(s:xdgcachehome.'/swap', 'p', 0700)
endif
@@ -320,7 +323,7 @@ endif
" Support for these persistent undo file caches was not released until v7.3.0,
" so we need to check for the feature’s presence before we enable it.
"
-if s:xdgcachehome !=# '' && has('persistent_undo')
+if exists('s:xdgcachehome') && s:xdgcachehome !=# '' && has('persistent_undo')
set undofile
if !isdirectory(s:xdgcachehome.'/undo')
call mkdir(s:xdgcachehome.'/undo', 'p', 0700)
@@ -335,7 +338,7 @@ endif
" directories of this type. This isn't a comma-separated list like the others
" ('backupdir', 'directory', 'spell', 'undodir')
"
-if s:xdgcachehome !=# '' && has('mksession')
+if exists('s:xdgcachehome') && s:xdgcachehome !=# '' && has('mksession')
if !isdirectory(s:xdgcachehome.'/view')
call mkdir(s:xdgcachehome.'/view', 'p', 0700)
endif
@@ -442,7 +445,8 @@ endif
" directory.
"
set dictionary^=/usr/share/dict/words
-if s:xdgdatahome !=# '' || !empty(s:xdgdatadirs)
+if exists('s:xdgdatahome') && s:xdgdatahome !=# ''
+ \ || exists('s:xdgdatadirs') && !empty(s:xdgdatadirs)
execute 'set dictionary^='.option#Escape(join(map(
\ extend(
\ s:xdgdatahome !=# '' ? [s:xdgdatahome] : [],
@@ -461,7 +465,8 @@ endif
" WordNet and MyThes-1. I had to remove the first two metadata lines from
" thesaurus.txt, as Vim appeared to interpret them as part of the body data.
"
-if s:xdgdatahome !=# '' || !empty(s:xdgdatadirs)
+if exists('s:xdgdatahome') && s:xdgdatahome !=# ''
+ \ || exists('s:xdgdatadirs') && !empty(s:xdgdatadirs)
execute 'set thesaurus^='.option#Escape(join(map(
\ extend(
\ s:xdgdatahome !=# '' ? [s:xdgdatahome] : [],