diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-25 09:00:52 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-25 09:00:52 +1200 |
commit | 669b695d8f8663f4c1bc8514e0738e2963b66167 (patch) | |
tree | 15b1f7119bd198d810b312bc6f194ab12d489e19 /vim/vimrc | |
parent | Correct .vimrc comment (diff) | |
download | dotfiles-669b695d8f8663f4c1bc8514e0738e2963b66167.tar.gz dotfiles-669b695d8f8663f4c1bc8514e0738e2963b66167.zip |
Move all local bindings out into .vimrc
This is the natural way of things, I think.
Diffstat (limited to 'vim/vimrc')
-rw-r--r-- | vim/vimrc | 45 |
1 files changed, 34 insertions, 11 deletions
@@ -215,12 +215,6 @@ if has('digraphs') digraph 8: 9731 " SNOWMAN U+2603 endif -" Use different keys for global and local leaders -if 1 - let g:mapleader = '\' - let g:maplocalleader = '_' -endif - " Normal mode leader mappings below; use a literal backslash rather than " <Leader> so that the non-plugin mappings work on vim-tiny @@ -272,14 +266,43 @@ nmap \x <Plug>StripTrailingWhitespace " \z sets NZ English spelling (compare \u) nnoremap \z :<C-U>setlocal spelllang=en_nz spelllang?<CR> -" Filetype-specific bindings +" Use underscore for a local leader, for any plugins that use the variable +if 1 + let g:maplocalleader = '_' +endif + +" Filetype-specific mappings below; use a literal underscore rather than +" <LocalLeader> to keep the commands short if has('autocmd') && v:version >= 700 augroup vimrc autocmd! - autocmd FileType diff - \ nmap <buffer> <LocalLeader>p <Plug>DiffPrune - autocmd FileType diff - \ xmap <buffer> <LocalLeader>p <Plug>DiffPrune + + " Diff: prune sections + autocmd FileType diff nmap <buffer> _p <Plug>DiffPrune + autocmd FileType diff xmap <buffer> _p <Plug>DiffPrune + + " HTML: lint and tidy + autocmd FileType html nmap <buffer> _l <Plug>HtmlLint + autocmd FileType html nmap <buffer> _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 + + " PHP: check + autocmd FileType php nmap <buffer> _c <Plug>PhpCheck + + " Shell: check and lint + autocmd FileType sh nmap <buffer> _c <Plug>ShCheck + autocmd FileType sh nmap <buffer> _l <Plug>ShLint + + " VimL: lint + autocmd FileType vim nmap <buffer> _l <Plug>VimLint + + " Zsh: check + autocmd FileType zsh nmap <buffer> _c <Plug>ZshCheck + augroup END endif |