diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-03 03:25:13 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2020-05-03 03:25:13 +1200 |
commit | 49413bad6c2448f4d65791a4400c84756f86e6e2 (patch) | |
tree | 868f368f44a519366fe00a3ee3efe58412017135 | |
parent | Merge branch 'release/v8.24.0' (diff) | |
parent | Bump VERSION (diff) | |
download | dotfiles-49413bad6c2448f4d65791a4400c84756f86e6e2.tar.gz dotfiles-49413bad6c2448f4d65791a4400c84756f86e6e2.zip |
Merge branch 'release/v8.25.0'v8.25.0
* release/v8.25.0:
Tighten :try block around 'dictionary'/'thesaurus'
Factor out iteration variables with some maps
Test dir lists for emptiness to avoid force :unlet
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | vim/vimrc | 53 |
2 files changed, 30 insertions, 27 deletions
@@ -1,2 +1,2 @@ -tejr dotfiles v8.24.0 -Sat, 02 May 2020 14:16:31 +0000 +tejr dotfiles v8.25.0 +Sat, 02 May 2020 15:25:10 +0000 @@ -2,7 +2,7 @@ " Tom Ryder (tejr)’s Literate Vimrc " ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ " -" Last updated: Sat, 02 May 2020 14:04:10 UTC +" Last updated: Sat, 02 May 2020 15:15:57 UTC " " │ And I was lifted up in heart, and thought " │ Of all my late-shown prowess in the lists, @@ -111,21 +111,23 @@ let s:xdgconfigpaths = xdg#['config']['dirs'] if xdg#['config']['home'] !=# v:null call insert(s:xdgconfigpaths, xdg#['config']['home']) endif -for s:xdgconfigpath in reverse(s:xdgconfigpaths) - execute 'set runtimepath^=' - \.option#Escape(option#item#Escape(s:xdgconfigpath)) - execute 'set runtimepath+=' - \.option#Escape(option#item#Escape(s:xdgconfigpath.'/after')) -endfor -unlet! s:xdgconfigpath +if !empty(s:xdgconfigpaths) + execute 'set runtimepath^='.option#Escape(join(map( + \ s:xdgconfigpaths, 'option#item#Escape(v:val)' + \), ',')) + execute 'set runtimepath+='.option#Escape(join(map( + \ reverse(s:xdgconfigpaths), 'option#item#Escape(v:val."/after")' + \), ',')) +endif 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'] !=# v:null - execute 'set runtimepath^=' - \.option#Escape(option#item#Escape(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 @@ -408,21 +410,22 @@ set spellcapcheck=[.?!]\\%(\ \ \\\|[\\n\\r\\t]\\) " 'isfname'; the blacklist is hard-coded. " set dictionary^=/usr/share/dict/words -try - let s:refdirs = xdg#['data']['dirs'] - if xdg#['data']['home'] !=# v:null - call insert(s:refdirs, xdg#['data']['home']) - endif - for s:refdir in reverse(s:refdirs) - execute 'set dictionary^=' - \.option#Escape(option#item#Escape(s:refdir.'/dictionary.txt')) - execute 'set thesaurus^=' - \.option#Escape(option#item#Escape(s:refdir.'/thesaurus.txt')) - endfor - unlet! s:refdir - unlet s:refdirs -catch /^Vim\%((\a\+)\)\=:E474:/ -endtry +let s:refdirs = xdg#['data']['dirs'] +if xdg#['data']['home'] !=# v:null + call insert(s:refdirs, xdg#['data']['home']) +endif +if !empty(s:refdirs) + try + execute 'set dictionary^='.option#Escape(join(map( + \ s:refdirs, 'option#item#Escape(v:val."/dictionary.txt")' + \), ',')) + execute 'set thesaurus^='.option#Escape(join(map( + \ s:refdirs, 'option#item#Escape(v:val."/thesaurus.txt")' + \), ',')) + catch /^Vim\%((\a\+)\)\=:E474:/ + endtry +endif +unlet s:refdirs " Next, we’ll modernize a little in adjusting some options with old " language-specific defaults. |