From a30ad11a3c99b257b86474beadb97c446eeb22f4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:02:13 +1200 Subject: Adjust use of part addenda to *dir options --- vim/vimrc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 908a0991..8e332960 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -24,8 +24,9 @@ set backspace+=start " Before the start of current insertion " Keep backup files in dedicated directory; add trailing double-slash to keep " full path in name, if Vim is new enough to support that set backup -execute 'set backupdir^='.vimrc#EscapeSetPart($MYVIM.'/cache/backup') - \ . (vimrc#Version('8.1.251') ? '//' : '') +execute 'set backupdir^='.vimrc#EscapeSetPart( + \ $MYVIM.'/cache/backup'.(vimrc#Version('8.1.251') ? '//' : '') + \ ) " Add some *nix paths not to back up if has('unix') @@ -55,7 +56,7 @@ set confirm set cpoptions+=J " Keep swap files in dedicated directory, named with full path -execute 'set directory^='.vimrc#EscapeSetPart($MYVIM.'/cache/swap') +execute 'set directory^='.vimrc#EscapeSetPart($MYVIM.'/cache/swap//') " If the environment didn't set an encoding, use UTF-8, not ASCII if !exists('$LANG') -- cgit v1.2.3 From 7dde8920fbedb8d16ba6fc4c45476cbea03cbd39 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:22:59 +1200 Subject: Add Makefile target to install free thesaurus --- Makefile | 6 ++++++ vim/vimrc | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 4340835e..64fbabe8 100644 --- a/Makefile +++ b/Makefile @@ -57,6 +57,7 @@ install-vim-indent \ install-vim-plugin \ install-vim-syntax \ + install-vim-thesaurus \ install-vint \ install-wget \ install-x \ @@ -630,6 +631,11 @@ install-vim-syntax: mkdir -p -- $(VIMDIR)/syntax cp -p -- vim/syntax/*.vim $(VIMDIR)/syntax +install-vim-thesaurus: + mkdir -p -- $(VIMDIR)/ref + curl 'https://sanctum.geek.nz/ref/thesaurus.txt' \ + > $(VIMDIR)/ref/thesaurus.txt + install-vint: cp -p -- vint/vintrc.yaml $(HOME)/.vintrc.yaml diff --git a/vim/vimrc b/vim/vimrc index 8e332960..f2ec6de8 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -156,6 +156,9 @@ set splitright " Right of the current window, not left " Don't try to syntax highlight run-on lines set synmaxcol=500 +" Add thesaurus; install with `make install-vim-thesaurus` +execute 'set thesaurus^='.vimrc#EscapeSetPart($MYVIM.'/ref/thesaurus.txt') + " PuTTY is a fast terminal, but Vim doesn't know that yet if &term =~# '^putty' set ttyfast -- cgit v1.2.3 From 513a72698b289d65160fe38f3e20fb272f0ed8e3 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:23:11 +1200 Subject: Correct 'shiftwidth' value in Makefiles --- vim/after/indent/make.vim | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 vim/after/indent/make.vim diff --git a/vim/after/indent/make.vim b/vim/after/indent/make.vim new file mode 100644 index 00000000..341cd7f6 --- /dev/null +++ b/vim/after/indent/make.vim @@ -0,0 +1,4 @@ +" Use 'tabstop' (8 columns, a full tab) for indent operations in Makefiles. +" It seems odd that the stock plugin doesn't force this on its own. +setlocal shiftwidth=0 +let b:undo_indent = 'setlocal shiftwidth<' -- cgit v1.2.3 From 80c9bdc87cf4cb52062ebcf8439e70b781626732 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:30:09 +1200 Subject: Add a 'dictionary' path --- vim/vimrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index f2ec6de8..1094a838 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -55,6 +55,9 @@ set confirm " Sentence objects are separated by two spaces set cpoptions+=J +" Specify where to look for a dictionary even if 'spell' isn't on +set dictionary^=/usr/share/dict/words + " Keep swap files in dedicated directory, named with full path execute 'set directory^='.vimrc#EscapeSetPart($MYVIM.'/cache/swap//') -- cgit v1.2.3 From f0555af0daf0ef17706dfa6ed8588d5c24682534 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:30:36 +1200 Subject: Adjust layout of longer :set+= path lines --- vim/vimrc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 1094a838..450121c7 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -160,7 +160,9 @@ set splitright " Right of the current window, not left set synmaxcol=500 " Add thesaurus; install with `make install-vim-thesaurus` -execute 'set thesaurus^='.vimrc#EscapeSetPart($MYVIM.'/ref/thesaurus.txt') +execute 'set thesaurus^='.vimrc#EscapeSetPart( + \ $MYVIM.'/ref/thesaurus.txt' + \ ) " PuTTY is a fast terminal, but Vim doesn't know that yet if &term =~# '^putty' @@ -176,7 +178,9 @@ endif " Keep persistent undo files in dedicated directory, named with full path if has('persistent_undo') " v7.2.438 set undofile - execute 'set undodir^='.vimrc#EscapeSetPart($MYVIM.'/cache/undo//') + execute 'set undodir^='.vimrc#EscapeSetPart( + \ $MYVIM.'/cache/undo//' + \ ) endif " Keep the viminfo file in the home Vim directory, mostly to stop history @@ -184,7 +188,9 @@ endif if exists('+viminfofile') " Use new option method if we can (v8.1.716) set viminfofile=$MYVIM/cache/viminfo else " Resort to clunkier method with 'viminfo' option flag - execute 'set viminfo+='.vimrc#EscapeSet('n'.$MYVIM.'/cache/viminfo') + execute 'set viminfo+='.vimrc#EscapeSet( + \ 'n'.$MYVIM.'/cache/viminfo' + \ ) endif " Let me move beyond buffer text in visual block mode -- cgit v1.2.3 From f9e44a9e8adc87ff04db9e4cde2d0ed61a9b26db Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:35:24 +1200 Subject: Let's give 'showmatch' another try But with a slightly quicker jump. --- vim/vimrc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 450121c7..31f7113c 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -125,6 +125,9 @@ set listchars+=extends:> " Unwrapped text to screen right set listchars+=precedes:< " Unwrapped text to screen left set listchars+=nbsp:+ " Non-breaking spaces +" Show matching brackets a bit more briefly +set matchtime=3 + " Don't allow setting options via buffer content set nomodeline @@ -152,6 +155,9 @@ set shortmess+=I " Prefix wrapped rows with three dots set showbreak=... +" Jump to matching bracket when typed in insert mode +set showmatch + " New window positioning set splitbelow " Below the current window, not above set splitright " Right of the current window, not left -- cgit v1.2.3 From 2c94109ed4b6e16bbf1b07c1ab5538909e301dfa Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:53:12 +1200 Subject: Create cache directories as needed with function --- vim/autoload/vimrc.vim | 9 +++++++++ vim/vimrc | 3 +++ 2 files changed, 12 insertions(+) diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 94922e93..2c9a9cd2 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -11,6 +11,15 @@ function! vimrc#EscapeSetPart(string) abort return vimrc#EscapeSet(escape(a:string, ',')) endfunction +" Expand the first path in an option string, check if it exists, and attempt +" to create it if it doesn't. +function! vimrc#Establish(string) abort + let part = vimrc#SplitOption(a:string)[0] + let dirname = expand(part) + return isdirectory(dirname) + \ || mkdir(dirname, 'p') +endfunction + " Check that we have a plugin available, and will be loading it function! vimrc#PluginReady(filename) abort return globpath(&runtimepath, 'plugin/'.a:filename.'.vim') !=# '' diff --git a/vim/vimrc b/vim/vimrc index 31f7113c..0c808661 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -27,6 +27,7 @@ set backup execute 'set backupdir^='.vimrc#EscapeSetPart( \ $MYVIM.'/cache/backup'.(vimrc#Version('8.1.251') ? '//' : '') \ ) +call vimrc#Establish(&backupdir) " Add some *nix paths not to back up if has('unix') @@ -60,6 +61,7 @@ set dictionary^=/usr/share/dict/words " Keep swap files in dedicated directory, named with full path execute 'set directory^='.vimrc#EscapeSetPart($MYVIM.'/cache/swap//') +call vimrc#Establish(&directory) " If the environment didn't set an encoding, use UTF-8, not ASCII if !exists('$LANG') @@ -187,6 +189,7 @@ if has('persistent_undo') " v7.2.438 execute 'set undodir^='.vimrc#EscapeSetPart( \ $MYVIM.'/cache/undo//' \ ) + call vimrc#Establish(&undodir) endif " Keep the viminfo file in the home Vim directory, mostly to stop history -- cgit v1.2.3 From 45e7fb1d9ada7e8c38bd8efae0a106c7f3afec12 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Thu, 6 Jun 2019 23:55:59 +1200 Subject: Strip trailing-double-slashes for dir creates --- vim/autoload/vimrc.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 2c9a9cd2..57c2f0f4 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -12,9 +12,10 @@ function! vimrc#EscapeSetPart(string) abort endfunction " Expand the first path in an option string, check if it exists, and attempt -" to create it if it doesn't. +" to create it if it doesn't. Strip double-trailing-slash hints. function! vimrc#Establish(string) abort let part = vimrc#SplitOption(a:string)[0] + let part = substitute(part, '//$', '', '') let dirname = expand(part) return isdirectory(dirname) \ || mkdir(dirname, 'p') -- cgit v1.2.3 From b12a7dea8c6e2c6bd1a733e22a70051753b52421 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 00:30:51 +1200 Subject: Adjust layout of another line --- vim/vimrc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vim/vimrc b/vim/vimrc index 0c808661..14eadc4b 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -60,7 +60,9 @@ set cpoptions+=J set dictionary^=/usr/share/dict/words " Keep swap files in dedicated directory, named with full path -execute 'set directory^='.vimrc#EscapeSetPart($MYVIM.'/cache/swap//') +execute 'set directory^='.vimrc#EscapeSetPart( + \ $MYVIM.'/cache/swap//' + \ ) call vimrc#Establish(&directory) " If the environment didn't set an encoding, use UTF-8, not ASCII -- cgit v1.2.3 From f0c188209161594cf4edc69a3f81ca71189a731a Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 00:30:58 +1200 Subject: Add a couple of abbreviations --- vim/vimrc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vim/vimrc b/vim/vimrc index 14eadc4b..1dcd3eaa 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -462,6 +462,10 @@ nnoremap :enew " \TAB toggles 'autoindent' nnoremap :setlocal autoindent! autoindent? +" Some useful abbreviations +inoreabbrev tr@ tom@sanctum.geek.nz +inoreabbrev tr/ + " Things I almsot always type wrnog inoreabbrev almsot almost inoreabbrev wrnog wrong -- cgit v1.2.3 From c8c890ba9203f77e56688e559cb7d65b67665188 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 01:11:00 +1200 Subject: Adjust quoting in mail greeting match --- vim/after/ftplugin/mail.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index e84702f0..cfb738a1 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -15,13 +15,13 @@ if line('.') == 1 && col('.') == 1 while getline('.') =~? '^> *' \ . '\%(' \ . '\%(' - \ . "g['\u2019]\\=day" + \ . 'g[''\u2019]\=day' \ . '\|\%(good \)\=\%(morning\|afternoon\|evening\)' \ . '\|h[eu]\%(ll\|rr\)o\+' \ . '\|hey\+' \ . '\|hi\+' \ . '\|sup' - \ . "\\|what['\u2019]\\=s up" + \ . '\|what[''\u2019]\=s up' \ . '\|yo' \ . '\)' \ . '[[:punct:] ]*' -- cgit v1.2.3 From bcad40034e1e472f18adcfec48998d114d3618be Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 01:11:16 +1200 Subject: Use shorter :map commands for diff/mail para nav --- vim/after/ftplugin/diff.vim | 24 ++++++++---------------- vim/after/ftplugin/mail.vim | 24 ++++++++---------------- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim index f9f6c4b3..8c3d5b1d 100644 --- a/vim/after/ftplugin/diff.vim +++ b/vim/after/ftplugin/diff.vim @@ -4,24 +4,16 @@ if exists('no_plugin_maps') || exists('no_diff_maps') endif " Maps using autoloaded function for quoted block movement -nnoremap [ +noremap [ \ :call diff#MoveBlock(v:count1, 1, 0) -nnoremap ] +sunmap [ +noremap ] \ :call diff#MoveBlock(v:count1, 0, 0) -onoremap [ - \ :call diff#MoveBlock(v:count1, 1, 0) -onoremap ] - \ :call diff#MoveBlock(v:count1, 0, 0) -xnoremap [ - \ :call diff#MoveBlock(v:count1, 1, 1) -xnoremap ] - \ :call diff#MoveBlock(v:count1, 0, 1) -let b:undo_ftplugin .= '|nunmap [' - \ . '|nunmap ]' - \ . '|ounmap [' - \ . '|ounmap ]' - \ . '|xunmap [' - \ . '|xunmap ]' +sunmap ] +let b:undo_ftplugin .= '|smap ] ' + \ . '|unmap ]' + \ . '|smap ] ' + \ . '|unmap ]' " Set mappings for diff pruning plugin nmap p diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index cfb738a1..85b7affd 100644 --- a/vim/after/ftplugin/mail.vim +++ b/vim/after/ftplugin/mail.vim @@ -114,21 +114,13 @@ let b:undo_ftplugin .= '|nunmap Q' \ . '|xunmap Q' " Maps using autoloaded function for quoted paragraph movement -nnoremap [ +noremap [ \ :call mail#NewBlank(v:count1, 1, 0) -nnoremap ] +sunmap [ +noremap ] \ :call mail#NewBlank(v:count1, 0, 0) -onoremap [ - \ :call mail#NewBlank(v:count1, 1, 0) -onoremap ] - \ :call mail#NewBlank(v:count1, 0, 0) -xnoremap [ - \ :call mail#NewBlank(v:count1, 1, 1) -xnoremap ] - \ :call mail#NewBlank(v:count1, 0, 1) -let b:undo_ftplugin .= '|nunmap [' - \ . '|nunmap ]' - \ . '|ounmap [' - \ . '|ounmap ]' - \ . '|xunmap [' - \ . '|xunmap ]' +sunmap ] +let b:undo_ftplugin .= '|smap ] ' + \ . '|unmap ]' + \ . '|smap ] ' + \ . '|unmap ]' -- cgit v1.2.3 From fa2fca2d9d24a830910558056de5b608fc2da517 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 01:11:59 +1200 Subject: Define :Boilerplate command for Perl, no --- vim/after/ftplugin/perl.vim | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/vim/after/ftplugin/perl.vim b/vim/after/ftplugin/perl.vim index d1e5dd52..a303fa75 100644 --- a/vim/after/ftplugin/perl.vim +++ b/vim/after/ftplugin/perl.vim @@ -18,9 +18,12 @@ if exists('no_plugin_maps') || exists('no_perl_maps') endif " Add boilerplate intelligently -nnoremap b - \ :call perl#Boilerplate() -let b:undo_ftplugin .= '|nunmap b' +command -buffer Boilerplate + \ call perl#Boilerplate() +nnoremap b + \ :Boilerplate +let b:undo_ftplugin .= '|delcommand Boilerplate' + \ . '|nunmap b' " Mappings to choose compiler nnoremap c -- cgit v1.2.3 From d4cd5910f6a296398b367350968f722175e37c1c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 01:18:42 +1200 Subject: Update vikm-quickfix-auto-open to v2.0.1 --- vim/bundle/quickfix_auto_open | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vim/bundle/quickfix_auto_open b/vim/bundle/quickfix_auto_open index 9a3808f3..b3b13854 160000 --- a/vim/bundle/quickfix_auto_open +++ b/vim/bundle/quickfix_auto_open @@ -1 +1 @@ -Subproject commit 9a3808f3b217f9cfc95d93ec111d33a0c239e922 +Subproject commit b3b1385490c60ad624d631b4cf99f84e058637b1 -- cgit v1.2.3 From a144fde8bb8d88519a03043982a10c77b31866c4 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Fri, 7 Jun 2019 01:19:11 +1200 Subject: Bump VERSION --- VERSION | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 01584736..188eb26d 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -tejr dotfiles v5.19.0 -Thu Jun 6 10:51:06 UTC 2019 +tejr dotfiles v5.20.0 +Thu Jun 6 13:19:11 UTC 2019 -- cgit v1.2.3