From fbf5479d6a5e12d0565c2213f08d27ffa36aca3c Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 25 Jun 2018 15:10:03 +1200 Subject: Reindent and refactor local leader mappings --- vim/vimrc | 49 ++++++++++++++++++++++++------------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/vim/vimrc b/vim/vimrc index 86f13359..6944c51e 100644 --- a/vim/vimrc +++ b/vim/vimrc @@ -274,41 +274,40 @@ if 1 let g:maplocalleader = '_' endif -" Filetype-specific mappings below; use a literal underscore rather than -" 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 * call vimrc#ClearLocalLeaderMaps() - " Diff: prune sections - autocmd FileType diff nmap _p DiffPrune - autocmd FileType diff xmap _p DiffPrune + " Diff: prune sections + autocmd FileType diff nmap p DiffPrune + autocmd FileType diff xmap p DiffPrune - " HTML: lint, URL-to-link, tidy - autocmd FileType html nmap _l HtmlLint - autocmd FileType html nmap _r HtmlUrlLink - autocmd FileType html nmap _t HtmlTidy + " HTML: lint, URL-to-link, tidy + autocmd FileType html nmap l HtmlLint + autocmd FileType html nmap r HtmlUrlLink + autocmd FileType html nmap t HtmlTidy - " Perl: check, lint, and tidy - autocmd FileType perl nmap _c PerlCheck - autocmd FileType perl nmap _l PerlLint - autocmd FileType perl nmap _t PerlTidy + " Perl: check, lint, and tidy + autocmd FileType perl nmap c PerlCheck + autocmd FileType perl nmap l PerlLint + autocmd FileType perl nmap t PerlTidy - " PHP: check - autocmd FileType php nmap _c PhpCheck + " PHP: check + autocmd FileType php nmap c PhpCheck - " Shell: check and lint - autocmd FileType sh nmap _c ShCheck - autocmd FileType sh nmap _l ShLint + " Shell: check and lint + autocmd FileType sh nmap c ShCheck + autocmd FileType sh nmap l ShLint - " VimL: lint - autocmd FileType vim nmap _l VimLint + " VimL: lint + autocmd FileType vim nmap l VimLint - " Zsh: check - autocmd FileType zsh nmap _c ZshCheck + " Zsh: check + autocmd FileType zsh nmap c ZshCheck augroup END endif -- cgit v1.2.3