aboutsummaryrefslogtreecommitdiff
path: root/vim
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-25 20:44:31 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-25 20:44:31 +1200
commit62aaa4eb10340bd2597b35307abc978f20cefc9c (patch)
treed292886b57e1800fb5e340340407b34d65a4af1a /vim
parentMerge branch 'release/v1.3.0' (diff)
parentBump VERSION (diff)
downloaddotfiles-62aaa4eb10340bd2597b35307abc978f20cefc9c.tar.gz
dotfiles-62aaa4eb10340bd2597b35307abc978f20cefc9c.zip
Merge branch 'release/v1.4.0'v1.4.0
* release/v1.4.0: Bump VERSION Rebuild dotfiles(7) manual page Update README.md about Vim mappings Add and apply new clear_local_maps.vim plugin Use <Leader> in vimrc where reasonable Reindent and refactor local leader mappings
Diffstat (limited to 'vim')
m---------vim/bundle/clear_local_maps0
-rw-r--r--vim/vimrc61
2 files changed, 30 insertions, 31 deletions
diff --git a/vim/bundle/clear_local_maps b/vim/bundle/clear_local_maps
new file mode 160000
+Subproject b1038f42ef051f2829464b60d3a4aa13f3020d3
diff --git a/vim/vimrc b/vim/vimrc
index 86f13359..12892474 100644
--- a/vim/vimrc
+++ b/vim/vimrc
@@ -219,12 +219,12 @@ if has('digraphs')
endif
" Normal mode leader mappings below; use a literal backslash rather than
-" <Leader> so that the non-plugin mappings work on vim-tiny
+" <Leader> on the non-plugin maps so that they work on vim-tiny
" \a toggles 'formatoptions' 'a' flag using a plugin
-nnoremap \a :<C-U>ToggleOptionFlagLocal formatoptions a<CR>
+nnoremap <Leader>a :<C-U>ToggleOptionFlagLocal formatoptions a<CR>
" \b toggles copy-pasteable linebreak settings
-nmap \b <Plug>CopyLinebreakToggle
+nmap <Leader>b <Plug>CopyLinebreakToggle
" \c toggles 'cursorcolumn', \C toggles 'cursorline'
nnoremap \c :<C-U>set cursorcolumn! cursorcolumn?<CR>
nnoremap \C :<C-U>set cursorline! cursorline?<CR>
@@ -250,8 +250,8 @@ nnoremap \l :<C-U>set list! list?<CR>
" \n toggles line numbers
nnoremap \n :<C-U>set number! number?<CR>
" \o and \O open 'pasted insert' lines
-nmap \o <Plug>PasteOpenBelow
-nmap \O <Plug>PasteOpenAbove
+nmap <Leader>o <Plug>PasteOpenBelow
+nmap <Leader>O <Plug>PasteOpenAbove
" \p toggles paste mode
nnoremap \p :<C-U>set paste! paste?<CR>
" \r reloads .vimrc
@@ -265,7 +265,7 @@ nnoremap \u :<C-U>setlocal spelllang=en_us spelllang?<CR>
" \w toggles wrapping
nnoremap \w :<C-U>set wrap! wrap?<CR>
" \x strips trailing whitespace via a custom plugin
-nmap \x <Plug>StripTrailingWhitespace
+nmap <Leader>x <Plug>StripTrailingWhitespace
" \z sets NZ English spelling (compare \u)
nnoremap \z :<C-U>setlocal spelllang=en_nz spelllang?<CR>
@@ -274,41 +274,40 @@ if 1
let g:maplocalleader = '_'
endif
-" Filetype-specific mappings below; use a literal underscore rather than
-" <LocalLeader> to keep the commands short
+" Filetype-specific mappings
if has('autocmd') && v:version >= 700
augroup vimrc_filetype_mappings
- autocmd!
+ autocmd!
- " Clear existing local leader maps
- autocmd FileType * call vimrc#ClearLocalLeaderMaps()
+ " Clear existing local leader maps
+ autocmd FileType * silent! call clear_local_maps#Clear()
- " Diff: prune sections
- autocmd FileType diff nmap <buffer> _p <Plug>DiffPrune
- autocmd FileType diff xmap <buffer> _p <Plug>DiffPrune
+ " Diff: prune sections
+ autocmd FileType diff nmap <buffer> <LocalLeader>p <Plug>DiffPrune
+ autocmd FileType diff xmap <buffer> <LocalLeader>p <Plug>DiffPrune
- " HTML: lint, URL-to-link, tidy
- autocmd FileType html nmap <buffer> _l <Plug>HtmlLint
- autocmd FileType html nmap <buffer> _r <Plug>HtmlUrlLink
- autocmd FileType html nmap <buffer> _t <Plug>HtmlTidy
+ " HTML: lint, URL-to-link, tidy
+ autocmd FileType html nmap <buffer> <LocalLeader>l <Plug>HtmlLint
+ autocmd FileType html nmap <buffer> <LocalLeader>r <Plug>HtmlUrlLink
+ autocmd FileType html nmap <buffer> <LocalLeader>t <Plug>HtmlTidy
- " Perl: check, lint, and tidy
- autocmd FileType perl nmap <buffer> _c <Plug>PerlCheck
- autocmd FileType perl nmap <buffer> _l <Plug>PerlLint
- autocmd FileType perl nmap <buffer> _t <Plug>PerlTidy
+ " Perl: check, lint, and tidy
+ autocmd FileType perl nmap <buffer> <LocalLeader>c <Plug>PerlCheck
+ autocmd FileType perl nmap <buffer> <LocalLeader>l <Plug>PerlLint
+ autocmd FileType perl nmap <buffer> <LocalLeader>t <Plug>PerlTidy
- " PHP: check
- autocmd FileType php nmap <buffer> _c <Plug>PhpCheck
+ " PHP: check
+ autocmd FileType php nmap <buffer> <LocalLeader>c <Plug>PhpCheck
- " Shell: check and lint
- autocmd FileType sh nmap <buffer> _c <Plug>ShCheck
- autocmd FileType sh nmap <buffer> _l <Plug>ShLint
+ " Shell: check and lint
+ autocmd FileType sh nmap <buffer> <LocalLeader>c <Plug>ShCheck
+ autocmd FileType sh nmap <buffer> <LocalLeader>l <Plug>ShLint
- " VimL: lint
- autocmd FileType vim nmap <buffer> _l <Plug>VimLint
+ " VimL: lint
+ autocmd FileType vim nmap <buffer> <LocalLeader>l <Plug>VimLint
- " Zsh: check
- autocmd FileType zsh nmap <buffer> _c <Plug>ZshCheck
+ " Zsh: check
+ autocmd FileType zsh nmap <buffer> <LocalLeader>c <Plug>ZshCheck
augroup END
endif