diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | VERSION | 4 | ||||
-rw-r--r-- | vim/after/ftplugin/diff.vim | 24 | ||||
-rw-r--r-- | vim/after/ftplugin/mail.vim | 28 | ||||
-rw-r--r-- | vim/after/ftplugin/perl.vim | 9 | ||||
-rw-r--r-- | vim/after/indent/make.vim | 4 | ||||
-rw-r--r-- | vim/autoload/vimrc.vim | 10 | ||||
m--------- | vim/bundle/quickfix_auto_open | 0 | ||||
-rw-r--r-- | vim/vimrc | 38 |
9 files changed, 79 insertions, 44 deletions
@@ -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 @@ -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 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 <buffer> <silent> <LocalLeader>[ +noremap <buffer> <silent> <LocalLeader>[ \ :<C-U>call diff#MoveBlock(v:count1, 1, 0)<CR> -nnoremap <buffer> <silent> <LocalLeader>] +sunmap <buffer> <LocalLeader>[ +noremap <buffer> <silent> <LocalLeader>] \ :<C-U>call diff#MoveBlock(v:count1, 0, 0)<CR> -onoremap <buffer> <silent> <LocalLeader>[ - \ :<C-U>call diff#MoveBlock(v:count1, 1, 0)<CR> -onoremap <buffer> <silent> <LocalLeader>] - \ :<C-U>call diff#MoveBlock(v:count1, 0, 0)<CR> -xnoremap <buffer> <silent> <LocalLeader>[ - \ :<C-U>call diff#MoveBlock(v:count1, 1, 1)<CR> -xnoremap <buffer> <silent> <LocalLeader>] - \ :<C-U>call diff#MoveBlock(v:count1, 0, 1)<CR> -let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>[' - \ . '|nunmap <buffer> <LocalLeader>]' - \ . '|ounmap <buffer> <LocalLeader>[' - \ . '|ounmap <buffer> <LocalLeader>]' - \ . '|xunmap <buffer> <LocalLeader>[' - \ . '|xunmap <buffer> <LocalLeader>]' +sunmap <buffer> <LocalLeader>] +let b:undo_ftplugin .= '|smap <buffer> <LocalLeader>] <nop>' + \ . '|unmap <buffer> <LocalLeader>]' + \ . '|smap <buffer> <LocalLeader>] <nop>' + \ . '|unmap <buffer> <LocalLeader>]' " Set mappings for diff pruning plugin nmap <buffer> <LocalLeader>p diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim index e84702f0..85b7affd 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:] ]*' @@ -114,21 +114,13 @@ let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q' \ . '|xunmap <buffer> <LocalLeader>Q' " Maps using autoloaded function for quoted paragraph movement -nnoremap <buffer> <silent> <LocalLeader>[ +noremap <buffer> <silent> <LocalLeader>[ \ :<C-U>call mail#NewBlank(v:count1, 1, 0)<CR> -nnoremap <buffer> <silent> <LocalLeader>] +sunmap <buffer> <LocalLeader>[ +noremap <buffer> <silent> <LocalLeader>] \ :<C-U>call mail#NewBlank(v:count1, 0, 0)<CR> -onoremap <buffer> <silent> <LocalLeader>[ - \ :<C-U>call mail#NewBlank(v:count1, 1, 0)<CR> -onoremap <buffer> <silent> <LocalLeader>] - \ :<C-U>call mail#NewBlank(v:count1, 0, 0)<CR> -xnoremap <buffer> <silent> <LocalLeader>[ - \ :<C-U>call mail#NewBlank(v:count1, 1, 1)<CR> -xnoremap <buffer> <silent> <LocalLeader>] - \ :<C-U>call mail#NewBlank(v:count1, 0, 1)<CR> -let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>[' - \ . '|nunmap <buffer> <LocalLeader>]' - \ . '|ounmap <buffer> <LocalLeader>[' - \ . '|ounmap <buffer> <LocalLeader>]' - \ . '|xunmap <buffer> <LocalLeader>[' - \ . '|xunmap <buffer> <LocalLeader>]' +sunmap <buffer> <LocalLeader>] +let b:undo_ftplugin .= '|smap <buffer> <LocalLeader>] <nop>' + \ . '|unmap <buffer> <LocalLeader>]' + \ . '|smap <buffer> <LocalLeader>] <nop>' + \ . '|unmap <buffer> <LocalLeader>]' 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 <buffer> <silent> <LocalLeader>b - \ :<C-U>call perl#Boilerplate()<CR> -let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>b' +command -buffer Boilerplate + \ call perl#Boilerplate() +nnoremap <buffer> <LocalLeader>b + \ :<C-U>Boilerplate<CR> +let b:undo_ftplugin .= '|delcommand Boilerplate' + \ . '|nunmap <buffer> <LocalLeader>b' " Mappings to choose compiler nnoremap <buffer> <LocalLeader>c 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<' diff --git a/vim/autoload/vimrc.vim b/vim/autoload/vimrc.vim index 94922e93..57c2f0f4 100644 --- a/vim/autoload/vimrc.vim +++ b/vim/autoload/vimrc.vim @@ -11,6 +11,16 @@ 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. 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') +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/bundle/quickfix_auto_open b/vim/bundle/quickfix_auto_open -Subproject 9a3808f3b217f9cfc95d93ec111d33a0c239e92 +Subproject b3b1385490c60ad624d631b4cf99f84e058637b @@ -24,8 +24,10 @@ 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') ? '//' : '') + \ ) +call vimrc#Establish(&backupdir) " Add some *nix paths not to back up if has('unix') @@ -54,8 +56,14 @@ 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') +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') @@ -121,6 +129,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 @@ -148,6 +159,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 @@ -155,6 +169,11 @@ 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 @@ -169,7 +188,10 @@ 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//' + \ ) + call vimrc#Establish(&undodir) endif " Keep the viminfo file in the home Vim directory, mostly to stop history @@ -177,7 +199,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 @@ -438,6 +462,10 @@ nnoremap <Leader><Insert> :<C-U>enew<CR> " \TAB toggles 'autoindent' nnoremap <Leader><Tab> :<C-U>setlocal autoindent! autoindent?<CR> +" Some useful abbreviations +inoreabbrev tr@ tom@sanctum.geek.nz +inoreabbrev tr/ <https://sanctum.geek.nz/> + " Things I almsot always type wrnog inoreabbrev almsot almost inoreabbrev wrnog wrong |