aboutsummaryrefslogtreecommitdiff
path: root/vim/vimrc
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2020-05-04 10:51:26 +1200
committerTom Ryder <tom@sanctum.geek.nz>2020-05-04 10:51:26 +1200
commit6f4a8288d4c5950ae4423dd1403e8536a447fafc (patch)
treeb43e717dac36d91ad9b3b28a863dc3f9afb021a9 /vim/vimrc
parentWorking on rewording vimrc (diff)
parentMerge branch 'hotfix/v8.28.2' into develop (diff)
downloaddotfiles-6f4a8288d4c5950ae4423dd1403e8536a447fafc.tar.gz
dotfiles-6f4a8288d4c5950ae4423dd1403e8536a447fafc.zip
Merge branch 'develop' into feature/vimrc-edit
* develop: Use global variable not autoload for undoskip.vim Test for correct feature for undoskip.vim plugin Flesh out new undoskip.vim plugin a lot Add plugin undoskip.vim; switch 'undofile' on path Update dotfiles(7) manual page Reflow features list Remove spaces around em-dashes Many README.md improvements in phrasing or grammar Order sub-targets of `install` correctly Update PGP key Update dotfiles(7) manual page Reformat paragraphs in README.md Remove outdated description of GnuPG config gen Update documentation of personal mail paths Add comment to installation dry run command Suggest creation of recommended path in docs Update recommended path in documentation Copy, don't reference XDG basedir lists Write v:null back out of XDG routines Remove trailing slashes from default XDG basedir Update PGP key fingerprint Use a dash rather than a three-period ellipsis Tighten :try block around 'dictionary'/'thesaurus' Factor out iteration variables with some maps Test dir lists for emptiness to avoid force :unlet Use v:null in XDG-related contexts Add handling of "after" subdirs in Vim XDG config Separate cache runtime behaviour from config Tolerate unset iteration variables Improve "absolute path" check for XDG base dirs Tidy and correct XDG var getenv() fallback Force unwanted --quoting-style option to ls(1) off Bump updated date for vimrc
Diffstat (limited to 'vim/vimrc')
-rw-r--r--vim/vimrc70
1 files changed, 41 insertions, 29 deletions
diff --git a/vim/vimrc b/vim/vimrc
index 7fef5533..a25e8f6d 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -2,7 +2,7 @@
" Tom Ryder (tejr)’s Literate Vimrc
" ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
"
-" Last updated: Wed, 29 Apr 2020 23:52:08 UTC
+" Last updated: Sun, 03 May 2020 22:50:34 UTC
"
" │ And I was lifted up in heart, and thought
" │ Of all my late-shown prowess in the lists,
@@ -108,22 +108,32 @@ endif
"
" <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#variables>
"
-" 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', including "after"
+" directories to the end of it, in reverse order, forming the desired layers
+" of configuration.
"
-let s:xdgruntimepaths = xdg#['config']['dirs']
+let s:xdgconfigpaths = copy(xdg#['config']['dirs'])
if xdg#['config']['home'] !=# ''
- call insert(s:xdgruntimepaths, xdg#['config']['home'])
+ call insert(s:xdgconfigpaths, xdg#['config']['home'])
endif
+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'] !=# ''
- call insert(s:xdgruntimepaths, xdg#['cache']['home'])
+ execute 'set runtimepath^='.option#Escape(
+ \ option#item#Escape(xdg#['cache']['home'])
+ \)
endif
-for s:xdgruntimepath in reverse(s:xdgruntimepaths)
- execute 'set runtimepath^='
- \.option#Escape(option#item#Escape(s:xdgruntimepath))
-endfor
-unlet s:xdgruntimepaths s:xdgruntimepath
" 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
@@ -405,20 +415,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'] !=# ''
- 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:refdirs s:refdir
-catch /^Vim\%((\a\+)\)\=:E474:/
-endtry
+let s:refdirs = copy(xdg#['data']['dirs'])
+if xdg#['data']['home'] !=# ''
+ 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.
@@ -917,9 +929,9 @@ endif
" almost always stands out too much for my liking.
"
" You’d think the pattern here could be used to match the color scheme name,
-" and it can be...after patch v7.4.108, when Christian Brabandt fixed it.
-" Until that version, it matched against the current buffer name, so we’re
-" forced to have an explicit test in the command instead.
+" and it can be—after patch v7.4.108, when Christian Brabandt fixed it. Until
+" that version, it matched against the current buffer name, so we’re forced to
+" have an explicit test in the command instead.
"
" <https://github.com/vim/vim/releases/tag/v7.4.108>
"