diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-17 00:53:17 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2019-06-17 00:53:17 +1200 |
commit | b7a2d67f38b947dfac366487a327c4c10c67aaa5 (patch) | |
tree | 10743f12a469f6b256c53579731296f0a5401c98 /vim/vimrc | |
parent | Merge branch 'release/v6.20.0' (diff) | |
parent | Update dotfiles(7) manual page (diff) | |
download | dotfiles-2af6f6dd662d1e63dd261565aa7bd261194a1f0b.tar.gz (sig) dotfiles-2af6f6dd662d1e63dd261565aa7bd261194a1f0b.zip |
Merge branch 'release/v6.21.0'v6.21.0
* release/v6.21.0:
Update dotfiles(7) manual page
Spelling and capitalisation fixes
Add load guards to Vim plugins not spun out yet
Adjust comma position in broken lines
Overhaul local Vim spellfile word list plugin
Refactor select_old_files.vim to allow count
Enhance load guard or select_old_files.vim
Add <Plug>SelectOldFiles mapping
Add a rough normal mode map to repeat with bang
Refactor and fix arg errors in put_date.vim plugin
Consolidate utc.vim and put_date.vim into latter
Document choice of format for PutDate()
More comment corrections
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 38 |
1 files changed, 28 insertions, 10 deletions
@@ -103,9 +103,9 @@ scriptencoding utf-8 " Vim, I love you, but you are really weird. " let s:runtimepath = map( - \ split(&runtimepath, '\\\@<!,[, ]*'), - \ "substitute(v:val, '\\\\,', '', 'g')" - \ ) + \ split(&runtimepath, '\\\@<!,[, ]*') + \,"substitute(v:val, '\\\\,', '', 'g')" + \) if !exists('$MYVIM') let $MYVIM = s:runtimepath[0] endif @@ -398,6 +398,22 @@ if has('persistent_undo') set undodir^=$MYVIM/cache/undo// endif +" For spelling, use New Zealand English by default, but later on we'll +" configure a leader mapping to switch to United States English, since I so +" often have to write for Yankees. We'll set the 'spellfile' option too, to +" place it in the cache directory into which we've been putting everything. +" We'll follow Vim's standard naming convention for the file itself, though. +" If available, my plugin spellfile_local.vim will extend this later to add +" more spelling word lists per filetype and per file. +" +set spelllang=en_nz +Establish $MYVIM/cache/spell +let &spellfile = $MYVIM.'/cache/spell/'.join([ + \ substitute(&spelllang, '_.*', '', '') + \,&encoding + \,'add' + \], '.') + " For word completion in insert mode with CTRL-X CTRL-K, or if 'complete' " includes the 'k' flag, the 'dictionary' option specifies the path to the " system word list. This makes the dictionary completion work consistently, @@ -991,7 +1007,7 @@ autocmd vimrc ColorScheme sahara " We'll have Vim try to use my 'sahara' fork of the 'desert256' color scheme. " If we fail to load the color scheme, for whatever reason, suppress the -" error, and default to a dark background (if not already) for the the default +" error, and default to a dark background (if not already) for the default " color scheme in the absence of guidance otherwise from a COLORFGBG " environment variable or a t_RB terminal response. Vim otherwise defaults to " 'light', which is less likely in my case. @@ -1384,15 +1400,15 @@ nnoremap <Leader>t nnoremap <Leader>T \ :<C-U>setlocal filetype=<CR> -" These mappings use my put_date.vim and utc.vim plugins for date insertion -" into the buffer. +" These mappings use my put_date.vim plugin for date insertion into the +" buffer. "" Leader,d inserts the local date (RFC 2822) nnoremap <Leader>d \ :PutDate<CR> "" Leader,D inserts the UTC date (RFC 2822) nnoremap <Leader>D - \ :<Home>UTC<End> PutDate<CR> + \ :PutDate!<CR> " This group contains mappings that are to do with file and path management " relative to the current buffer. The Leader,P mapping that creates @@ -1466,12 +1482,11 @@ nnoremap <Leader>j " Leader,o hacks up the list of old files from viminfo just long enough to " ensure that :browse :oldfiles fits in a screen, avoiding an Enter or 'q' -" keypress before entering the number. This one is handy followed by +" keystroke before entering the number. This one is handy followed by " <Leader>,\ to jump back to the last remembered position in that file, since " by definition viminfo remembers that mark, too. " -nnoremap <Leader>o - \ :<C-U>SelectOldFiles<CR> +nmap <Leader>o <Plug>SelectOldFiles " This group defines mappings for filtering and batch operations to clean up " buffer text. All of these mappings use commands from my custom plugins: @@ -1555,6 +1570,9 @@ nnoremap <Leader>? "" Leader,. runs the configured make program into the location list nnoremap <Leader>. \ :<C-U>lmake!<CR> +"" Leader,! repeats the last command, adding a bang +nnoremap <Leader>! + \ :<Up><Home><S-Right>!<CR> "" Leader,q formats the current paragraph nnoremap <Leader>q gqap "" Leader,r acts as a replacement operator |