aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-04 15:08:51 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-04 15:08:51 +1300
commit1b8d301ffb3b30addadd7ea26f92d6eca4dfdcd8 (patch)
tree181d2520c60bde44e0d4c1245369403722c4042a
parentMerge branch 'release/v2.8.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-1b8d301ffb3b30addadd7ea26f92d6eca4dfdcd8.tar.gz
dotfiles-1b8d301ffb3b30addadd7ea26f92d6eca4dfdcd8.zip
Merge branch 'release/v3.0.0'v3.0.0
* release/v3.0.0: Remove b:undo_ftplugin cmds for double-key maps Remove accidentally created html.vim~ file Use "stub .vimrc" method to dodge vim-tiny Use :help for 'keywordprg', junk tag binding Unseat tidy(1) as HTML 'equalprg' Remove line squeezing function for mail.vim
-rw-r--r--Makefile3
-rw-r--r--VERSION4
-rw-r--r--vim/after/ftplugin/diff.vim1
-rw-r--r--vim/after/ftplugin/gitcommit.vim2
-rw-r--r--vim/after/ftplugin/help.vim13
-rw-r--r--vim/after/ftplugin/html.vim11
-rw-r--r--vim/after/ftplugin/mail.vim2
-rw-r--r--vim/after/ftplugin/markdown.vim2
-rw-r--r--vim/autoload/html.vim7
-rw-r--r--vim/autoload/mail.vim20
-rw-r--r--vim/vimrc224
-rw-r--r--vim/vimrc.stub.vim4
12 files changed, 138 insertions, 155 deletions
diff --git a/Makefile b/Makefile
index 882982c6..2629ec55 100644
--- a/Makefile
+++ b/Makefile
@@ -517,7 +517,7 @@ install-urxvt: urxvt/ext/select
VIM = vim
VIMDIR = $(HOME)/.vim
-VIMRC = $(HOME)/.vimrc
+VIMRC = $(HOME)/.vim/vimrc
install-vim: install-vim-after \
install-vim-autoload \
@@ -582,6 +582,7 @@ install-vim-compiler:
cp -p -- vim/compiler/*.vim $(VIMDIR)/compiler
install-vim-config: install-vim-cache
+ cp -p -- vim/vimrc.stub.vim $(HOME)/.vimrc
cp -p -- vim/vimrc $(VIMRC)
if [ -e /etc/debian_version ] ; then \
cp -p -- vim/system/debian.vim $(VIMDIR)/system.vim ; \
diff --git a/VERSION b/VERSION
index a5c7149a..ddca6083 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1,2 @@
-tejr dotfiles v2.8.0
-Sun Dec 2 10:12:15 UTC 2018
+tejr dotfiles v3.0.0
+Tue Dec 4 02:08:39 UTC 2018
diff --git a/vim/after/ftplugin/diff.vim b/vim/after/ftplugin/diff.vim
index 123f0d0a..5d4ff9ae 100644
--- a/vim/after/ftplugin/diff.vim
+++ b/vim/after/ftplugin/diff.vim
@@ -30,4 +30,3 @@ xmap <buffer> <LocalLeader>p
\ <Plug>(DiffPrune)
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>p'
\ . '|xunmap <buffer> <LocalLeader>p'
- \ . '|nunmap <buffer> <LocalLeader>pp'
diff --git a/vim/after/ftplugin/gitcommit.vim b/vim/after/ftplugin/gitcommit.vim
index 1a4c1b1b..618b9324 100644
--- a/vim/after/ftplugin/gitcommit.vim
+++ b/vim/after/ftplugin/gitcommit.vim
@@ -25,7 +25,6 @@ nnoremap <buffer> <expr> <LocalLeader>q
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
- \ . '|nunmap <buffer> <LocalLeader>qq'
\ . '|xunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
@@ -34,5 +33,4 @@ nnoremap <buffer> <expr> <LocalLeader>Q
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
- \ . '|nunmap <buffer> <LocalLeader>QQ'
\ . '|xunmap <buffer> <LocalLeader>Q'
diff --git a/vim/after/ftplugin/help.vim b/vim/after/ftplugin/help.vim
index ae032344..a0b637aa 100644
--- a/vim/after/ftplugin/help.vim
+++ b/vim/after/ftplugin/help.vim
@@ -11,13 +11,16 @@ if has('conceal') && &modifiable && !&readonly
let b:undo_ftplugin .= '|setlocal conceallevel<'
endif
+" Use :help for 'keywordprg'; odd that this isn't the default
+setlocal keywordprg=:help
+let b:undo_ftplugin .= '|setlocal keywordprg<'
+
" Stop here if the user doesn't want ftplugin mappings
if exists('g:no_plugin_maps') || exists('g:no_help_maps')
finish
endif
-" Make K jump to the help topic; NeoVim does this, and it's a damned good idea
-if !has('nvim')
- nnoremap <buffer> K <C-]>
- let b:undo_ftplugin .= '|nunmap <buffer> K'
-endif
+" ,K runs :helpgrep on the word under the cursor
+nnoremap <buffer> <LocalLeader>K
+ \ :<C-U>helpgrep <cword><CR>
+let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>K'
diff --git a/vim/after/ftplugin/html.vim b/vim/after/ftplugin/html.vim
index b5c387fb..5f7155bc 100644
--- a/vim/after/ftplugin/html.vim
+++ b/vim/after/ftplugin/html.vim
@@ -3,11 +3,16 @@ if &filetype !=# 'html'
finish
endif
-" Use tidy(1) for checking and program formatting
+" Use tidy(1) for checking
compiler tidy
-setlocal equalprg=tidy\ -quiet
let b:undo_ftplugin .= '|unlet b:current_compiler'
- \ . '|setlocal equalprg< errorformat< makeprg<'
+ \ . '|setlocal errorformat< makeprg<'
+
+" tidy(1) copes fine with formatting an entire document, but not just part of
+" it; we map \= to do the former, but don't actually set 'equalprg', falling
+" back on the good-enough built-in Vim indentation behavior.
+nnoremap <buffer> <Leader>= :<C-U>call html#TidyBuffer()<CR>
+let b:undo_ftplugin .= '|nunmap <buffer> <Leader>='
" Set up hooks for timestamp updating
augroup html_timestamp
diff --git a/vim/after/ftplugin/mail.vim b/vim/after/ftplugin/mail.vim
index 74ec1699..ffaa6709 100644
--- a/vim/after/ftplugin/mail.vim
+++ b/vim/after/ftplugin/mail.vim
@@ -57,7 +57,6 @@ nnoremap <buffer> <expr> <LocalLeader>q
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
- \ . '|nunmap <buffer> <LocalLeader>qq'
\ . '|xunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
@@ -66,7 +65,6 @@ nnoremap <buffer> <expr> <LocalLeader>Q
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
- \ . '|nunmap <buffer> <LocalLeader>QQ'
\ . '|xunmap <buffer> <LocalLeader>Q'
" Maps using autoloaded function for quoted paragraph movement
diff --git a/vim/after/ftplugin/markdown.vim b/vim/after/ftplugin/markdown.vim
index f129deba..82fbe9da 100644
--- a/vim/after/ftplugin/markdown.vim
+++ b/vim/after/ftplugin/markdown.vim
@@ -27,7 +27,6 @@ nnoremap <buffer> <expr> <LocalLeader>q
xnoremap <buffer> <expr> <LocalLeader>q
\ quote#Quote()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>q'
- \ . '|nunmap <buffer> <LocalLeader>qq'
\ . '|xunmap <buffer> <LocalLeader>q'
" Quote operator with reformatting
@@ -36,5 +35,4 @@ nnoremap <buffer> <expr> <LocalLeader>Q
xnoremap <buffer> <expr> <LocalLeader>Q
\ quote#QuoteReformat()
let b:undo_ftplugin .= '|nunmap <buffer> <LocalLeader>Q'
- \ . '|nunmap <buffer> <LocalLeader>QQ'
\ . '|xunmap <buffer> <LocalLeader>Q'
diff --git a/vim/autoload/html.vim b/vim/autoload/html.vim
index c3d99706..e0d47e47 100644
--- a/vim/autoload/html.vim
+++ b/vim/autoload/html.vim
@@ -14,6 +14,13 @@ function! html#UrlLink() abort
endfunction
+" Tidy the whole buffer
+function! html#TidyBuffer() abort
+ let l:view = winsaveview()
+ %!tidy -quiet
+ call winrestview(l:view)
+endfunction
+
" Update a timestamp
function! html#TimestampUpdate() abort
if !&modified
diff --git a/vim/autoload/mail.vim b/vim/autoload/mail.vim
index 967aac17..baff4bbf 100644
--- a/vim/autoload/mail.vim
+++ b/vim/autoload/mail.vim
@@ -65,23 +65,3 @@ function! mail#NewBlank(count, up, visual) abort
endif
endfunction
-
-" Quick map to strip multiple blank lines in the entire buffer; this comes up
-" a lot when replying to stripped HTML mail. This should really be a command,
-" but I'll do that Later(TM).
-function! mail#ContractMultipleBlankLines() abort
- let l:deletions = []
- let l:blank = 0
- for l:num in range(1, line('$'))
- if getline(l:num) !~# '^[> ]*$'
- let l:blank = 0
- elseif l:blank
- let l:deletions += [l:num - 1]
- else
- let l:blank = 1
- endif
- endfor
- for l:num in reverse(l:deletions)
- execute l:num . 'delete'
- endfor
-endfunction
diff --git a/vim/vimrc b/vim/vimrc
index 0e489226..f5ffec73 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,20 +1,5 @@
" Tom Ryder (tejr)'s vimrc: <https://sanctum.geek.nz/cgit/dotfiles.git>
-"
-" This file is designed to load on any build of Vim version 7.0 or newer,
-" including tiny builds without +eval.
-
-" Require at least Vim 7.0 (released 2006-05-08); otherwise, self-suppress as
-" much of this config as possible
-if v:version < 700
- if has('win32') || has('win64')
- set runtimepath-=~/vimfiles
- set runtimepath-=~/vimfiles/after
- else
- set runtimepath-=~/.vim
- set runtimepath-=~/.vim/after
- endif
- finish
-endif
+" Requires Vim 7.0 or newer with +eval.
" Undo anything the operating system's vimrc may have broken
runtime system.vim
@@ -38,8 +23,14 @@ if has('syntax')
silent! colorscheme sahara
endif
- " If not sahara, then default with dark background
- if !exists('g:colors_name')
+ " If my colorscheme loaded, turn on subtle 'cursorline' coloring
+ if exists('g:colors_name') && g:colors_name ==# 'sahara'
+ if exists('+cursorline')
+ set cursorline
+ endif
+
+ " If it didn't load, default to default scheme with dark background
+ else
set background=dark
endif
@@ -58,22 +49,22 @@ set backspace+=start " The start of current insertion
" Try to keep backups in one system-appropriate dir
set backup
-set backupdir^=~/.vim/cache/backup
if has('win32') || has('win64')
- set backupdir-=~/.vim/cache/backup
set backupdir^=~/vimfiles/cache/backup
+else
+ set backupdir^=~/.vim/cache/backup
endif
" Add some paths not to back up
-set backupskip^=/dev/shm/* " Shared memory RAM disk
-set backupskip^=/var/tmp/* " Debian's $TMPDIR for sudoedit(8)
-if !has('unix')
- set backupskip-=/dev/shm/*
- set backupskip-=/var/tmp/*
+if has('unix')
+ set backupskip^=/dev/shm/* " Shared memory RAM disk
+ set backupskip^=/var/tmp/* " Debian's $TMPDIR for sudoedit(8)
endif
-" Indent wrapped lines
-silent! set breakindent
+" Indent wrapped lines if supported
+if exists('+breakindent')
+ set breakindent
+endif
" Clear default 'comments' value, let the filetype handle it
set comments=
@@ -87,18 +78,11 @@ endif
" Give me a prompt instead of just rejecting risky :write, :saveas
set confirm
-" Only turn on 'cursorline' if my colorscheme loaded
-if exists('+cursorline')
- if exists('g:colors_name') && g:colors_name ==# 'sahara'
- set cursorline
- endif
-endif
-
" Try to keep swapfiles in one system-appropriate dir
-set directory^=~/.vim/cache/swap//
if has('win32') || has('win64')
- set directory-=~/.vim/cache/swap//
set directory^=~/vimfiles/cache/swap//
+else
+ set directory^=~/.vim/cache/swap//
endif
" Use UTF-8 if we can and env LANG didn't tell us not to
@@ -107,8 +91,10 @@ if has('multi_byte') && !exists('$LANG') && &encoding ==# 'latin1'
endif
" Don't wait for a key after Escape in insert mode
-" In vim-tiny but not NeoVim, so just suppress errors
-silent! set noesckeys
+" Not in NeoVim
+if exists('+esckeys')
+ set noesckeys
+endif
" Fold based on indent, but only when I ask
if has('folding')
@@ -117,7 +103,9 @@ if has('folding')
endif
" Delete comment leaders when joining lines, if supported
-silent! set formatoptions+=j
+if v:version > 703 || v:version == 703 && has('patch541')
+ set formatoptions+=j
+endif
" If available, use GNU grep niceties for searching
if system('grep --version') =~# '^grep (GNU grep)'
@@ -137,9 +125,7 @@ set history=2000
" Highlight completed searches; clear on reload
set hlsearch
-if 1
- nohlsearch
-endif
+nohlsearch
" Don't assume I'm editing C; let the filetype set this
set include=
@@ -163,11 +149,11 @@ set lazyredraw
set linebreak
" Define extra 'list' display characters
-set listchars+=extends:> " Unwrapped text to screen right
-set listchars+=precedes:< " Unwrapped text to screen left
-set listchars+=tab:>- " Tab characters, preserve width
-set listchars+=trail:_ " Trailing spaces
-silent! set listchars+=nbsp:+ " Non-breaking spaces
+set listchars+=extends:> " Unwrapped text to screen right
+set listchars+=precedes:< " Unwrapped text to screen left
+set listchars+=tab:>- " Tab characters, preserve width
+set listchars+=trail:_ " Trailing spaces
+set listchars+=nbsp:+ " Non-breaking spaces
" Don't allow setting options via buffer content
set nomodeline
@@ -205,7 +191,9 @@ set splitright " Right of the current window, not left
set timeoutlen=3000
" No terminal mouse, even if we could
-silent! set ttymouse=
+if exists('+ttymouse')
+ set ttymouse=
+endif
" Keep undo files, hopefully in a dedicated directory
if has('persistent_undo')
@@ -218,9 +206,11 @@ if has('persistent_undo')
endif
" Wildmenu settings; see also plugin/wildignore.vim
-set wildmenu " Use wildmenu
-set wildmode=list:longest " Tab press completes and lists
-silent! set wildignorecase " Case insensitive, if supported
+set wildmenu " Use wildmenu
+set wildmode=list:longest " Tab press completes and lists
+if exists('+wildignorecase')
+ set wildignorecase " Case insensitive, if supported
+endif
" Let me move beyond buffer text in visual block mode
if exists('+virtualedit')
@@ -273,164 +263,164 @@ nnoremap ]l :lnext<CR>
nmap [<Space> <Plug>(PutBlankLinesAbove)
nmap ]<Space> <Plug>(PutBlankLinesBelow)
-" Normal leader maps; use <Bslash> not <Leader> for vim-tiny
+" Normal leader maps; use <Leader> not <Leader> for vim-tiny
" \a toggles 'formatoptions' 'a' flag using a plugin
-nnoremap <Bslash>a :<C-U>ToggleFlagLocal formatoptions a<CR>
+nnoremap <Leader>a :<C-U>ToggleFlagLocal formatoptions a<CR>
" \b toggles copy-pasteable linebreak settings
-nmap <Bslash>b <Plug>(CopyLinebreakToggle)
+nmap <Leader>b <Plug>(CopyLinebreakToggle)
" \c toggles 'cursorline'; no visual mode map as it doesn't work
-nnoremap <Bslash>c :<C-U>setlocal cursorline! cursorline?<CR>
+nnoremap <Leader>c :<C-U>setlocal cursorline! cursorline?<CR>
" \C toggles 'cursorcolumn'; works in visual mode
-nnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>
-xnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
+nnoremap <Leader>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>
+xnoremap <Leader>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
" \d inserts the local date (POSIX date)
-nnoremap <Bslash>d :read !date<CR>
+nnoremap <Leader>d :read !date<CR>
" \D inserts the UTC date (POSIX date)
-nnoremap <Bslash>D :read !date -u<CR>
+nnoremap <Leader>D :read !date -u<CR>
" \e forces a buffer to be editable
-nnoremap <Bslash>e :<C-U>setlocal modifiable noreadonly<CR>
+nnoremap <Leader>e :<C-U>setlocal modifiable noreadonly<CR>
" \f shows the current 'formatoptions' at a glance
-nnoremap <Bslash>f :<C-U>setlocal formatoptions?<CR>
+nnoremap <Leader>f :<C-U>setlocal formatoptions?<CR>
" \F reloads filetype plugins
-nnoremap <Bslash>F :<C-U>doautocmd filetypedetect BufRead<CR>
+nnoremap <Leader>F :<C-U>doautocmd filetypedetect BufRead<CR>
" \g changes directory to the current file's location
-nnoremap <Bslash>g :<C-U>cd %:h<CR>:pwd<CR>
+nnoremap <Leader>g :<C-U>cd %:h<CR>:pwd<CR>
" \h toggles highlighting search results
-nnoremap <Bslash>h :<C-U>set hlsearch! hlsearch?<CR>
+nnoremap <Leader>h :<C-U>set hlsearch! hlsearch?<CR>
" \H shows command history
-nnoremap <Bslash>H :<C-U>history :<CR>
+nnoremap <Leader>H :<C-U>history :<CR>
" \i toggles showing matches as I enter my pattern
-nnoremap <Bslash>i :<C-U>set incsearch! incsearch?<CR>
+nnoremap <Leader>i :<C-U>set incsearch! incsearch?<CR>
" \j jumps to buffers (jetpack)
-nnoremap <Bslash>j :<C-U>buffers<CR>:buffer<Space>
+nnoremap <Leader>j :<C-U>buffers<CR>:buffer<Space>
" \k shows my marks
-nnoremap <Bslash>k :<C-U>marks<CR>
+nnoremap <Leader>k :<C-U>marks<CR>
" \l toggles showing tab, end-of-line, and trailing whitespace
-nnoremap <Bslash>l :<C-U>setlocal list! list?<CR>
-xnoremap <Bslash>l :<C-U>setlocal list! list?<CR>gv
+nnoremap <Leader>l :<C-U>setlocal list! list?<CR>
+xnoremap <Leader>l :<C-U>setlocal list! list?<CR>gv
" \m shows normal maps
-nnoremap <Bslash>m :<C-U>map<CR>
+nnoremap <Leader>m :<C-U>map<CR>
" \M shows buffer-local normal maps
-nnoremap <Bslash>M :<C-U>map <buffer><CR>
+nnoremap <Leader>M :<C-U>map <buffer><CR>
" \n toggles line number display
-nnoremap <Bslash>n :<C-U>setlocal number! number?<CR>
-xnoremap <Bslash>n :<C-U>setlocal number! number?<CR>gv
+nnoremap <Leader>n :<C-U>setlocal number! number?<CR>
+xnoremap <Leader>n :<C-U>setlocal number! number?<CR>gv
" \N toggles position display in bottom right
-nnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>
-xnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>gv
+nnoremap <Leader>N :<C-U>set ruler! ruler?<CR>
+xnoremap <Leader>N :<C-U>set ruler! ruler?<CR>gv
" \o opens a line below in paste mode
-nmap <Bslash>o <Plug>(PasteOpenBelow)
+nmap <Leader>o <Plug>(PasteOpenBelow)
" \O opens a line above in paste mode
-nmap <Bslash>O <Plug>(PasteOpenAbove)
+nmap <Leader>O <Plug>(PasteOpenAbove)
" \p toggles paste mode
-nnoremap <Bslash>p :<C-U>set paste! paste?<CR>
+nnoremap <Leader>p :<C-U>set paste! paste?<CR>
" \q formats the current paragraph
-nnoremap <Bslash>q gqap
+nnoremap <Leader>q gqap
" \r acts as a replacement operator
-nmap <Bslash>r <Plug>(ReplaceOperator)
-xmap <Bslash>r <Plug>(ReplaceOperator)
+nmap <Leader>r <Plug>(ReplaceOperator)
+xmap <Leader>r <Plug>(ReplaceOperator)
" \R reloads ~/.vimrc
-nnoremap <Bslash>R :<C-U>source $MYVIMRC<CR>
+nnoremap <Leader>R :<C-U>source $MYVIMRC<CR>
" \s toggles spell checking
-nnoremap <Bslash>s :<C-U>setlocal spell! spell?<CR>
+nnoremap <Leader>s :<C-U>setlocal spell! spell?<CR>
" \t shows current filetype
-nnoremap <Bslash>t :<C-U>setlocal filetype?<CR>
+nnoremap <Leader>t :<C-U>setlocal filetype?<CR>
" \T clears filetype
-nnoremap <Bslash>T :<C-U>setlocal filetype=<CR>
+nnoremap <Leader>T :<C-U>setlocal filetype=<CR>
" \u sets US English spelling (compare \z)
-nnoremap <Bslash>u :<C-U>setlocal spelllang=en_us<CR>
+nnoremap <Leader>u :<C-U>setlocal spelllang=en_us<CR>
" \v shows all global variables
-nnoremap <Bslash>v :<C-U>let g: v:<CR>
+nnoremap <Leader>v :<C-U>let g: v:<CR>
" \V shows all local variables
-nnoremap <Bslash>V :<C-U>let b: t: w:<CR>
+nnoremap <Leader>V :<C-U>let b: t: w:<CR>
" \w toggles wrapping
-nnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>
-xnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>gv
+nnoremap <Leader>w :<C-U>setlocal wrap! wrap?<CR>
+xnoremap <Leader>w :<C-U>setlocal wrap! wrap?<CR>gv
" \x strips trailing whitespace via a custom plugin
-nmap <Bslash>x :StripTrailingWhitespace<CR>
-xmap <Bslash>x :StripTrailingWhitespace<CR>
+nmap <Leader>x :StripTrailingWhitespace<CR>
+xmap <Leader>x :StripTrailingWhitespace<CR>
" \X squeezes repeated blank lines via a custom plugin
-nmap <Bslash>X :SqueezeRepeatBlanks<CR>
-xmap <Bslash>X :SqueezeRepeatBlanks<CR>
+nmap <Leader>X :SqueezeRepeatBlanks<CR>
+xmap <Leader>X :SqueezeRepeatBlanks<CR>
" \y shows all registers
-nnoremap <Bslash>y :<C-U>registers<CR>
+nnoremap <Leader>y :<C-U>registers<CR>
" \z sets NZ English spelling (compare \u)
-nnoremap <Bslash>z :<C-U>setlocal spelllang=en_nz<CR>
+nnoremap <Leader>z :<C-U>setlocal spelllang=en_nz<CR>
" \= runs the whole buffer through =, preserving position
-nnoremap <Bslash>= :<C-U>call vimrc#Anchor('1G=G')<CR>
+nnoremap <Leader>= :<C-U>call vimrc#Anchor('1G=G')<CR>
" \+ runs the whole buffer through gq, preserving position
-nnoremap <Bslash>+ :<C-U>call vimrc#Anchor('1GgqG')<CR>
+nnoremap <Leader>+ :<C-U>call vimrc#Anchor('1GgqG')<CR>
" \. runs the configured make program into the location list
-nnoremap <Bslash>. :<C-U>lmake!<CR>
+nnoremap <Leader>. :<C-U>lmake!<CR>
" \< and \> adjust indent of last edit; good for pasting
-nnoremap <Bslash><lt> :<C-U>'[,']<lt><CR>
-nnoremap <Bslash>> :<C-U>'[,']><CR>
+nnoremap <Leader><lt> :<C-U>'[,']<lt><CR>
+nnoremap <Leader>> :<C-U>'[,']><CR>
" \_ uses last changed or yanked text as a characterwise object
-onoremap <Bslash>_ :<C-U>normal! `[v`]<CR>
+onoremap <Leader>_ :<C-U>normal! `[v`]<CR>
" \% uses entire buffer as a linewise object
-onoremap <Bslash>% :<C-U>normal! 1GVG<CR>
+onoremap <Leader>% :<C-U>normal! 1GVG<CR>
" \{ and \} move to lines with non-space chars before current column
-nmap <Bslash>{ <Plug>(VerticalRegionUpNormal)
-nmap <Bslash>} <Plug>(VerticalRegionDownNormal)
-omap <Bslash>{ <Plug>(VerticalRegionUpOperator)
-omap <Bslash>} <Plug>(VerticalRegionDownOperator)
-xmap <Bslash>{ <Plug>(VerticalRegionUpVisual)
-xmap <Bslash>} <Plug>(VerticalRegionDownVisual)
+nmap <Leader>{ <Plug>(VerticalRegionUpNormal)
+nmap <Leader>} <Plug>(VerticalRegionDownNormal)
+omap <Leader>{ <Plug>(VerticalRegionUpOperator)
+omap <Leader>} <Plug>(VerticalRegionDownOperator)
+xmap <Leader>{ <Plug>(VerticalRegionUpVisual)
+xmap <Leader>} <Plug>(VerticalRegionDownVisual)
" \/ types :vimgrep for me ready to enter a search pattern
-nnoremap <Bslash>/ :<C-U>vimgrep /\c/ **<S-Left><S-Left><Right>
+nnoremap <Leader>/ :<C-U>vimgrep /\c/ **<S-Left><S-Left><Right>
" \? types :helpgrep for me ready to enter a search pattern
-nnoremap <Bslash>? :<C-U>helpgrep \c<S-Left>
+nnoremap <Leader>? :<C-U>helpgrep \c<S-Left>
" \DEL deletes the current buffer
-nnoremap <Bslash><Delete> :bdelete<CR>
+nnoremap <Leader><Delete> :bdelete<CR>
" \INS edits a new buffer
-nnoremap <Bslash><Insert> :<C-U>enew<CR>
+nnoremap <Leader><Insert> :<C-U>enew<CR>
" Execution mappings; each of these clobbers register z
" \@ executes line in normal mode
-nnoremap <Bslash>@ ^"zyg_@z
+nnoremap <Leader>@ ^"zyg_@z
" \: executes line in command mode
-nnoremap <Bslash>: ^"zyg_:<C-R>z<CR>
+nnoremap <Leader>: ^"zyg_:<C-R>z<CR>
" \! executes line with 'shell'
-nnoremap <Bslash>! ^"zyg_:!<C-R>z<CR>
+nnoremap <Leader>! ^"zyg_:!<C-R>z<CR>
" Source any .vim files from ~/.vim/config
runtime! config/*.vim
diff --git a/vim/vimrc.stub.vim b/vim/vimrc.stub.vim
new file mode 100644
index 00000000..51ca436a
--- /dev/null
+++ b/vim/vimrc.stub.vim
@@ -0,0 +1,4 @@
+" If we have Vim version >=7, and (implicitly) +eval, source real vimrc
+if v:version >= 700
+ runtime vimrc
+endif