aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION4
-rw-r--r--finger/pgpkey14
-rw-r--r--vim/after/ftplugin/gitcommit.vim16
-rw-r--r--vim/autoload/argument.vim8
-rw-r--r--vim/autoload/option.vim6
-rw-r--r--vim/autoload/path.vim4
-rw-r--r--vim/vimrc22
7 files changed, 30 insertions, 44 deletions
diff --git a/VERSION b/VERSION
index 9375bb0b..99df474c 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v8.13.0
-Sun, 16 Feb 2020 03:09:30 +0000
+tejr dotfiles v8.17.0
+Sun, 05 Apr 2020 13:24:21 +0000
diff --git a/finger/pgpkey b/finger/pgpkey
index 1f62c961..e69de29b 100644
--- a/finger/pgpkey
+++ b/finger/pgpkey
@@ -1,14 +0,0 @@
-pub rsa4096 2013-03-12 [SC] [expires: 2020-05-16]
- FA09 C06E 1B67 0CD0 B2F5 DE60 C142 86EA 77BB 8872
-uid [ultimate] Thomas Ryder (tyrmored, tejr) <tom@sanctum.geek.nz>
-uid [ultimate] Thomas Ryder <tejr@echo-n.nz>
-uid [ultimate] Thomas Ryder <secretary@plug.org.nz>
-uid [ultimate] Thomas Ryder (TEJR) <tejr@cpan.org>
-uid [ultimate] Thomas Ryder <tyrmored@inspire.net.nz>
-uid [ultimate] Thomas Ryder <tej.ryder@gmail.com>
-sub rsa4096 2013-03-12 [E] [expires: 2020-05-16]
- 9DF1 A89F F8D9 70AF 3265 C882 96C2 CD91 E67A C61D
-sub rsa4096 2013-03-12 [S] [expires: 2020-05-16]
- 3179 90A1 4597 A1FC F82D 953A B5AF 5F89 2592 6609
-sub rsa4096 2019-08-06 [A] [expires: 2020-05-16]
- 42AE 569D 6162 7C52 03B0 74ED D58F F1F0 7E90 9B49
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index 4a1c3814..093dc5f5 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -4,13 +4,15 @@ setlocal formatoptions+=coqr
let b:undo_ftplugin .= '|setlocal comments< formatoptions<'
" Choose the color column depending on non-comment line count
-augroup gitcommit_cursorcolumn
- autocmd CursorMoved,CursorMovedI <buffer>
- \ let &l:colorcolumn = gitcommit#CursorColumn()
-augroup END
-let b:undo_ftplugin .= '|execute ''autocmd! gitcommit_cursorcolumn'''
- \ . '|augroup! gitcommit_cursorcolumn'
- \ . '|setlocal colorcolumn<'
+if exists('&colorcolumn')
+ augroup gitcommit_cursorcolumn
+ autocmd CursorMoved,CursorMovedI <buffer>
+ \ let &l:colorcolumn = gitcommit#CursorColumn()
+ augroup END
+ let b:undo_ftplugin .= '|execute ''autocmd! gitcommit_cursorcolumn'''
+ \ . '|augroup! gitcommit_cursorcolumn'
+ \ . '|setlocal colorcolumn<'
+endif
" Stop here if the user doesn't want ftplugin mappings
if exists('no_plugin_maps') || exists('no_gitcommit_maps')
diff --git a/vim/autoload/argument.vim b/vim/autoload/argument.vim
deleted file mode 100644
index 85d75eb1..00000000
--- a/vim/autoload/argument.vim
+++ /dev/null
@@ -1,8 +0,0 @@
-" Escape a single argument for use on an Ex command line; essentially
-" a backport of fnameescape() for versions before v7.1.299
-"
-function! argument#Escape(argument) abort
- return exists('*fnameescape')
- \ ? fnameescape(a:argument)
- \ : escape(a:argument, "\n\r\t".' *?[{`$\%#''"|!<')
-endfunction
diff --git a/vim/autoload/option.vim b/vim/autoload/option.vim
index 5ff44ced..c44cf94b 100644
--- a/vim/autoload/option.vim
+++ b/vim/autoload/option.vim
@@ -9,3 +9,9 @@ function! option#Split(expr, ...) abort
let parts = split(a:expr, '\\\@<!,[, ]*', keepempty)
return map(parts, 'substitute(v:val, ''\\,'', '','', ''g'')')
endfunction
+
+" Escape the right-hand side of a :set option value
+"
+function! option#Escape(expr) abort
+ return escape(a:expr, ' |"\')
+endfunction
diff --git a/vim/autoload/path.vim b/vim/autoload/path.vim
index e230cab2..54aacbc2 100644
--- a/vim/autoload/path.vim
+++ b/vim/autoload/path.vim
@@ -4,10 +4,10 @@ function! path#Create(name, ...) abort
if a:0 > 2
echoerr 'Too many arguments'
endif
- if isdirectory(a:name)
+ let name = fnamemodify(a:name, ':p')
+ if isdirectory(name)
return 1
endif
- let name = a:name
let path = 'p'
let prot = a:0 == 1 && a:1 ? 0700 : 0755
return mkdir(name, path, prot)
diff --git a/vim/vimrc b/vim/vimrc
index 2328bb11..d0525c30 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -99,7 +99,7 @@ scriptencoding utf-8
" list becomes MYVIM.
"
if exists('$MYVIM') && $MYVIM !=# ''
- execute 'set runtimepath^='.argument#Escape(option#item#Escape($MYVIM, 1))
+ execute 'set runtimepath^='.option#Escape(option#item#Escape($MYVIM, 1))
elseif &runtimepath !=# ''
let $MYVIM = option#Split(&runtimepath)[0]
endif
@@ -133,8 +133,8 @@ command! -bang -bar -complete=dir -nargs=1 CreatePath
"
" <https://github.com/vim/vim/releases/tag/v8.1.0716>
"
-execute 'set viminfo+='.argument#Escape('n'.$MYVIM.'/viminfo')
-CreatePath $MYVIM
+execute 'set viminfo+='.option#Escape('n'.$MYVIM.'/viminfo')
+call path#Create($MYVIM)
" Speaking of recorded data in viminfo files, the default Vim limit of a mere
" 50 entries for command and search history is pretty stingy. Because I don’t
@@ -179,10 +179,10 @@ set history=10000
" 'backupfullname', 'swapfilefullname' would have been clearer.
"
set backup
-execute 'set backupdir^='.argument#Escape(option#item#Escape(
+execute 'set backupdir^='.option#Escape(option#item#Escape(
\ $MYVIM.'/backup'.(has#('patch-8.1.251') ? '//' : ''),
\))
-CreatePath! $MYVIM/backup
+call path#Create($MYVIM.'/backup')
" Files in certain directories on Unix-compatible filesystems should not be
" backed up, for security reasons. This is particularly important if editing
@@ -219,8 +219,8 @@ endif
" apply path#Create() to attempt to create the path, if needed.
"
execute 'set directory^='
- \.argument#Escape(option#item#Escape($MYVIM.'/swap//'))
-CreatePath! $MYVIM/swap
+ \.option#Escape(option#item#Escape($MYVIM.'/swap//'))
+call path#Create($MYVIM.'/swap')
" Keep tracked undo history for files permanently, in a dedicated cache
" directory, so that the u/:undo and CTRL-R/:redo commands will work between
@@ -238,8 +238,8 @@ CreatePath! $MYVIM/swap
if has#('persistent_undo')
set undofile
execute 'set undodir^='
- \.argument#Escape(option#item#Escape($MYVIM.'/undo//'))
- CreatePath! $MYVIM/undo
+ \.option#Escape(option#item#Escape($MYVIM.'/undo//'))
+ call path#Create($MYVIM.'/undo')
endif
" Now that we have a bit more confidence in our runtime environment, set up
@@ -357,9 +357,9 @@ set dictionary^=/usr/share/dict/words
let s:ref = $MYVIM.'/ref'
try
execute 'set dictionary^='
- \.argument#Escape(option#item#Escape(s:ref.'/dictionary.txt'))
+ \.option#Escape(option#item#Escape(s:ref.'/dictionary.txt'))
execute 'set thesaurus^='
- \.argument#Escape(option#item#Escape(s:ref.'/thesaurus.txt'))
+ \.option#Escape(option#item#Escape(s:ref.'/thesaurus.txt'))
catch /^Vim\%((\a\+)\)\=:E474:/
endtry