diff options
authorTom Ryder <tom@sanctum.geek.nz>2018-11-30 09:34:34 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-11-30 09:34:34 +1300
commite819f04d4f3106c963315a601de86ef7ce5dbac2 (patch)
parentMerge branch 'hotfix/v2.0.1' (diff)
parentBump VERSION (diff)
downloaddotfiles-2.1.0.tar.gz (sig)
Merge branch 'release/v2.1.0'v2.1.0
* release/v2.1.0: Bump VERSION Remove pre-7.0 Vim handling/boilerplate
3 files changed, 32 insertions, 45 deletions
diff --git a/VERSION b/VERSION
index 334920ab..e7ac2aed 100644
@@ -1,2 +1,2 @@
-tejr dotfiles v2.0.1
-Thu Nov 29 11:12:22 UTC 2018
+tejr dotfiles v2.1.0
+Thu Nov 29 20:34:34 UTC 2018
diff --git a/vim/after/indent/vim.vim b/vim/after/indent/vim.vim
index 548d3e5c..3d439458 100644
--- a/vim/after/indent/vim.vim
+++ b/vim/after/indent/vim.vim
@@ -1,8 +1,11 @@
+" Remove inapplicable defaults from 'indentkeys'
+" Should only need to undo this if the stock plugin didn't
+setlocal indentkeys-=0#,0{,0},0),:
+if !exists('b:undo_indent')
+ let b:undo_indent = '|setlocal indentkeys<'
" Observe VimL conventions for two-space indents
setlocal shiftwidth=2
setlocal softtabstop=2
let b:undo_indent .= '|setlocal shiftwidth< softtabstop<'
-" Remove inapplicable defaults from 'indentkeys'
-setlocal indentkeys-=0#,0{,0},0),:
-let b:undo_indent .= '|setlocal indentkeys<'
diff --git a/vim/vimrc b/vim/vimrc
index d8832fb7..09b9ca0f 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -1,20 +1,24 @@
" Tom Ryder (tejr)'s vimrc: <https://sanctum.geek.nz/cgit/dotfiles.git>
-" This file is designed to load without unsuppressed errors on Vim 6.0 and up.
-" Anything older than that will probably break. There are also some odd bits
-" of logic to cope with loading as much config as possible on vim-tiny.
+" 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)
+if v:version < 700
+ finish
" Undo anything the operating system's vimrc may have broken
runtime system.vim
" Load filetype settings, plugins, and maps
-if has('autocmd') && v:version >= 700
+if has('autocmd')
let g:maplocalleader = ','
filetype plugin indent on
" Options dependent on the syntax feature
-if has('syntax') && v:version >= 700
+if has('syntax')
" Use syntax highlighting
if !exists('g:syntax_on')
@@ -223,7 +227,7 @@ nnoremap <silent> <C-L> :<C-U>nohlsearch<CR><C-L>
vnoremap <silent> <C-L> :<C-U>nohlsearch<CR>gv<C-L>
" Remap insert Ctrl-C to undo the escaped insert operation
-if &loadplugins " Don't break the key if we won't be getting the plugin
+if &loadplugins " Don't break the key if we won't be loading the plugin
imap <C-C> <Plug>(InsertCancel)
@@ -232,16 +236,14 @@ imap <C-K><C-K> <Plug>(DigraphSearch)
" Remap normal space to scroll down a page
nnoremap <Space> <PageDown>
-" If we have plugins, do a :next after hitting the last line
-if &loadplugins
+" Do a :next after hitting the last line
+if &loadplugins " Don't change the mapping if we won't be loading the plugin
nmap <Space> <Plug>(ScrollNext)
" Remap normal/visual & to preserve substitution flags
nnoremap <silent> & :&&<CR>
-if exists(':xnoremap')
- xnoremap <silent> & :&&<CR>
+xnoremap <silent> & :&&<CR>
" Map g: as a 'colon operator'
nmap g: <Plug>(ColonOperator)
@@ -275,9 +277,7 @@ nmap <Bslash>b <Plug>(CopyLinebreakToggle)
nnoremap <Bslash>c :<C-U>setlocal cursorline! cursorline?<CR>
" \C toggles 'cursorcolumn'; works in visual mode
nnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>
-if exists(':xnoremap')
- xnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
+xnoremap <Bslash>C :<C-U>setlocal cursorcolumn! cursorcolumn?<CR>gv
" \d inserts the local date (POSIX date)
nnoremap <Bslash>d :read !date<CR>
@@ -313,9 +313,7 @@ nnoremap <Bslash>k :<C-U>marks<CR>
" \l toggles showing tab, end-of-line, and trailing whitespace
nnoremap <Bslash>l :<C-U>setlocal list! list?<CR>
-if exists(':xnoremap')
- xnoremap <Bslash>l :<C-U>setlocal list! list?<CR>gv
+xnoremap <Bslash>l :<C-U>setlocal list! list?<CR>gv
" \m shows normal maps
nnoremap <Bslash>m :<C-U>map<CR>
@@ -324,14 +322,10 @@ nnoremap <Bslash>M :<C-U>map <buffer><CR>
" \n toggles line number display
nnoremap <Bslash>n :<C-U>setlocal number! number?<CR>
-if exists(':xnoremap')
- xnoremap <Bslash>n :<C-U>setlocal number! number?<CR>gv
+xnoremap <Bslash>n :<C-U>setlocal number! number?<CR>gv
" \N toggles position display in bottom right
nnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>
-if exists(':xnoremap')
- xnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>gv
+xnoremap <Bslash>N :<C-U>set ruler! ruler?<CR>gv
" \o opens a line below in paste mode
nmap <Bslash>o <Plug>(PasteOpenBelow)
@@ -346,9 +340,7 @@ nnoremap <Bslash>q gqap
" \r acts as a replacement operator
nmap <Bslash>r <Plug>(ReplaceOperator)
-if exists(':xmap')
- xmap <Bslash>r <Plug>(ReplaceOperator)
+xmap <Bslash>r <Plug>(ReplaceOperator)
" \R reloads ~/.vimrc
nnoremap <Bslash>R :<C-U>source $MYVIMRC<CR>
@@ -371,21 +363,15 @@ nnoremap <Bslash>V :<C-U>let b: t: w:<CR>
" \w toggles wrapping
nnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>
-if exists(':xnoremap')
- xnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>gv
+xnoremap <Bslash>w :<C-U>setlocal wrap! wrap?<CR>gv
" \x strips trailing whitespace via a custom plugin
nmap <Bslash>x :StripTrailingWhitespace<CR>
-if exists(':xmap')
- xmap <Bslash>x :StripTrailingWhitespace<CR>
+xmap <Bslash>x :StripTrailingWhitespace<CR>
" \X squeezes repeated blank lines via a custom plugin
nmap <Bslash>X :SqueezeRepeatBlanks<CR>
-if exists(':xmap')
- xmap <Bslash>X :SqueezeRepeatBlanks<CR>
+xmap <Bslash>X :SqueezeRepeatBlanks<CR>
" \y shows all registers
nnoremap <Bslash>y :<C-U>registers<CR>
@@ -416,10 +402,8 @@ nmap <Bslash>{ <Plug>(VerticalRegionUpNormal)
nmap <Bslash>} <Plug>(VerticalRegionDownNormal)
omap <Bslash>{ <Plug>(VerticalRegionUpOperator)
omap <Bslash>} <Plug>(VerticalRegionDownOperator)
-if exists(':xmap')
- xmap <Bslash>{ <Plug>(VerticalRegionUpVisual)
- xmap <Bslash>} <Plug>(VerticalRegionDownVisual)
+xmap <Bslash>{ <Plug>(VerticalRegionUpVisual)
+xmap <Bslash>} <Plug>(VerticalRegionDownVisual)
" \/ types :vimgrep for me ready to enter a search pattern
nnoremap <Bslash>/ :<C-U>vimgrep /\c/ **<S-Left><S-Left><Right>