aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-06-16 21:59:31 +1200
committerTom Ryder <tom@sanctum.geek.nz>2018-06-16 21:59:31 +1200
commit88defc4fc528bad2b0664c634d95e4363665472d (patch)
tree333f2a15365563c5af18e92fa331de0190ae9046
parent408ec4c0450fe11064dfea6d786ae543111a2575 (diff)
downloaddotfiles-88defc4fc528bad2b0664c634d95e4363665472d.tar.gz
Use short-circuit for no-mapping check
-rw-r--r--vim/after/ftplugin/html/lint.vim36
-rw-r--r--vim/after/ftplugin/html/tidy.vim36
-rw-r--r--vim/after/ftplugin/html/url_link.vim36
-rw-r--r--vim/after/ftplugin/perl/check.vim36
-rw-r--r--vim/after/ftplugin/perl/lint.vim36
-rw-r--r--vim/after/ftplugin/perl/tidy.vim36
-rw-r--r--vim/after/ftplugin/php/check.vim36
-rw-r--r--vim/after/ftplugin/sh/check.vim36
-rw-r--r--vim/after/ftplugin/sh/lint.vim36
-rw-r--r--vim/after/ftplugin/vim/lint.vim36
-rw-r--r--vim/after/ftplugin/zsh/check.vim34
11 files changed, 197 insertions, 197 deletions
diff --git a/vim/after/ftplugin/html/lint.vim b/vim/after/ftplugin/html/lint.vim
index 65742267..64df3447 100644
--- a/vim/after/ftplugin/html/lint.vim
+++ b/vim/after/ftplugin/html/lint.vim
@@ -27,27 +27,27 @@ function! s:HtmlLint()
cwindow
endfunction
-" Set up a mapping for the linter, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_html_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_html_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>HtmlLint
+ \ :<C-U>call <SID>HtmlLint()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>HtmlLint'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>HtmlLint')
+ nmap <buffer> <unique>
+ \ <LocalLeader>l
\ <Plug>HtmlLint
- \ :<C-U>call <SID>HtmlLint()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>HtmlLint'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>HtmlLint')
- nmap <buffer> <unique>
- \ <LocalLeader>l
- \ <Plug>HtmlLint
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>l'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>l'
endif
-
endif
diff --git a/vim/after/ftplugin/html/tidy.vim b/vim/after/ftplugin/html/tidy.vim
index 6e612feb..3d14e79e 100644
--- a/vim/after/ftplugin/html/tidy.vim
+++ b/vim/after/ftplugin/html/tidy.vim
@@ -13,27 +13,27 @@ if exists('b:undo_ftplugin')
\ . '|unlet b:did_ftplugin_html_tidy'
endif
-" Set up a mapping for the tidier, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_html_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_html_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>HtmlTidy
+ \ :<C-U>%!tidy -quiet<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>HtmlTidy'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>HtmlTidy')
+ nmap <buffer> <unique>
+ \ <LocalLeader>t
\ <Plug>HtmlTidy
- \ :<C-U>%!tidy -quiet<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>HtmlTidy'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>HtmlTidy')
- nmap <buffer> <unique>
- \ <LocalLeader>t
- \ <Plug>HtmlTidy
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>t'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>t'
endif
-
endif
diff --git a/vim/after/ftplugin/html/url_link.vim b/vim/after/ftplugin/html/url_link.vim
index a5a926d6..c256b3b9 100644
--- a/vim/after/ftplugin/html/url_link.vim
+++ b/vim/after/ftplugin/html/url_link.vim
@@ -29,27 +29,27 @@ function! s:HtmlUrlLink()
endfunction
-" Set up a mapping for the function, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_html_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_html_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>HtmlUrlLink
+ \ :<C-U>call <SID>HtmlUrlLink()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>HtmlUrlLink'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>HtmlUrlLink')
+ nmap <buffer> <unique>
+ \ <LocalLeader>r
\ <Plug>HtmlUrlLink
- \ :<C-U>call <SID>HtmlUrlLink()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>HtmlUrlLink'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>HtmlUrlLink')
- nmap <buffer> <unique>
- \ <LocalLeader>r
- \ <Plug>HtmlUrlLink
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>r'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>r'
endif
-
endif
diff --git a/vim/after/ftplugin/perl/check.vim b/vim/after/ftplugin/perl/check.vim
index a9b23c2b..e5eaf44a 100644
--- a/vim/after/ftplugin/perl/check.vim
+++ b/vim/after/ftplugin/perl/check.vim
@@ -21,27 +21,27 @@ function! s:PerlCheck()
cwindow
endfunction
-" Set up a mapping for the checker, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_perl_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_perl_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>PerlCheck
+ \ :<C-U>call <SID>PerlCheck()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>PerlCheck'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>PerlCheck')
+ nmap <buffer> <unique>
+ \ <LocalLeader>c
\ <Plug>PerlCheck
- \ :<C-U>call <SID>PerlCheck()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>PerlCheck'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>PerlCheck')
- nmap <buffer> <unique>
- \ <LocalLeader>c
- \ <Plug>PerlCheck
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>c'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>c'
endif
-
endif
diff --git a/vim/after/ftplugin/perl/lint.vim b/vim/after/ftplugin/perl/lint.vim
index 235ee69a..50770a13 100644
--- a/vim/after/ftplugin/perl/lint.vim
+++ b/vim/after/ftplugin/perl/lint.vim
@@ -21,27 +21,27 @@ function! s:PerlLint()
cwindow
endfunction
-" Set up a mapping for the linter, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_perl_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_perl_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>PerlLint
+ \ :<C-U>call <SID>PerlLint()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>PerlLint'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>PerlLint')
+ nmap <buffer> <unique>
+ \ <LocalLeader>l
\ <Plug>PerlLint
- \ :<C-U>call <SID>PerlLint()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>PerlLint'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>PerlLint')
- nmap <buffer> <unique>
- \ <LocalLeader>l
- \ <Plug>PerlLint
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>l'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>l'
endif
-
endif
diff --git a/vim/after/ftplugin/perl/tidy.vim b/vim/after/ftplugin/perl/tidy.vim
index 18033a42..bd3e73a1 100644
--- a/vim/after/ftplugin/perl/tidy.vim
+++ b/vim/after/ftplugin/perl/tidy.vim
@@ -9,27 +9,27 @@ if exists('b:undo_ftplugin')
\ . '|unlet b:did_ftplugin_perl_tidy'
endif
-" Set up a mapping for the tidier, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_perl_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_perl_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>PerlTidy
+ \ :<C-U>%!perltidy<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>PerlTidy'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>PerlTidy')
+ nmap <buffer> <unique>
+ \ <LocalLeader>t
\ <Plug>PerlTidy
- \ :<C-U>%!perltidy<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>PerlTidy'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>PerlTidy')
- nmap <buffer> <unique>
- \ <LocalLeader>t
- \ <Plug>PerlTidy
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>t'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>t'
endif
-
endif
diff --git a/vim/after/ftplugin/php/check.vim b/vim/after/ftplugin/php/check.vim
index 58b41c21..5f131d94 100644
--- a/vim/after/ftplugin/php/check.vim
+++ b/vim/after/ftplugin/php/check.vim
@@ -29,27 +29,27 @@ function! s:PhpCheck()
cwindow
endfunction
-" Set up a mapping for the checker, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_php_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_php_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>PhpCheck
+ \ :<C-U>call <SID>PhpCheck()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>PhpCheck'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>PhpCheck')
+ nmap <buffer> <unique>
+ \ <LocalLeader>c
\ <Plug>PhpCheck
- \ :<C-U>call <SID>PhpCheck()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>PhpCheck'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>PhpCheck')
- nmap <buffer> <unique>
- \ <LocalLeader>c
- \ <Plug>PhpCheck
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>c'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>c'
endif
-
endif
diff --git a/vim/after/ftplugin/sh/check.vim b/vim/after/ftplugin/sh/check.vim
index 3eaf3f57..dce6552c 100644
--- a/vim/after/ftplugin/sh/check.vim
+++ b/vim/after/ftplugin/sh/check.vim
@@ -38,27 +38,27 @@ if !exists('*s:ShCheck')
endfunction
endif
-" Set up a mapping for the checker, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_sh_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_sh_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>ShCheck
+ \ :<C-U>call <SID>ShCheck()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>ShCheck'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>ShCheck')
+ nmap <buffer> <unique>
+ \ <LocalLeader>c
\ <Plug>ShCheck
- \ :<C-U>call <SID>ShCheck()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>ShCheck'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>ShCheck')
- nmap <buffer> <unique>
- \ <LocalLeader>c
- \ <Plug>ShCheck
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>c'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>c'
endif
-
endif
diff --git a/vim/after/ftplugin/sh/lint.vim b/vim/after/ftplugin/sh/lint.vim
index a8d65702..b89645f7 100644
--- a/vim/after/ftplugin/sh/lint.vim
+++ b/vim/after/ftplugin/sh/lint.vim
@@ -36,27 +36,27 @@ function! s:ShLint()
cwindow
endfunction
-" Set up a mapping for the linter, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_sh_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_sh_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>ShLint
+ \ :<C-U>call <SID>ShLint()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>ShLint'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>ShLint')
+ nmap <buffer> <unique>
+ \ <LocalLeader>l
\ <Plug>ShLint
- \ :<C-U>call <SID>ShLint()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>ShLint'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>ShLint')
- nmap <buffer> <unique>
- \ <LocalLeader>l
- \ <Plug>ShLint
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>l'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>l'
endif
-
endif
diff --git a/vim/after/ftplugin/vim/lint.vim b/vim/after/ftplugin/vim/lint.vim
index 86a8b16f..ef04d852 100644
--- a/vim/after/ftplugin/vim/lint.vim
+++ b/vim/after/ftplugin/vim/lint.vim
@@ -21,27 +21,27 @@ function! s:VimLint()
cwindow
endfunction
-" Set up a mapping for the linter, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_vim_maps')
+" Stop here if the user doesn't want ftplugin mappings
+if exists('g:no_plugin_maps') || exists('g:no_vim_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>VimLint
+ \ :<C-U>call <SID>VimLint()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>VimLint'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>VimLint')
+ nmap <buffer> <unique>
+ \ <LocalLeader>l
\ <Plug>VimLint
- \ :<C-U>call <SID>VimLint()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>VimLint'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>VimLint')
- nmap <buffer> <unique>
- \ <LocalLeader>l
- \ <Plug>VimLint
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>l'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>l'
endif
-
endif
diff --git a/vim/after/ftplugin/zsh/check.vim b/vim/after/ftplugin/zsh/check.vim
index 371ca2c6..c0c8a342 100644
--- a/vim/after/ftplugin/zsh/check.vim
+++ b/vim/after/ftplugin/zsh/check.vim
@@ -22,26 +22,26 @@ function! s:ZshCheck()
endfunction
" Set up a mapping for the checker, if we're allowed
-if !exists('g:no_plugin_maps') && !exists('g:no_zsh_maps')
+if exists('g:no_plugin_maps') || exists('g:no_zsh_maps')
+ finish
+endif
- " Define a mapping target
- nnoremap <buffer> <silent> <unique>
+" Define a mapping target
+nnoremap <buffer> <silent> <unique>
+ \ <Plug>ZshCheck
+ \ :<C-U>call <SID>ZshCheck()<CR>
+if exists('b:undo_ftplugin')
+ let b:undo_ftplugin = b:undo_ftplugin
+ \ . '|nunmap <buffer> <Plug>ZshCheck'
+endif
+
+" If there isn't a key mapping already, use a default one
+if !hasmapto('<Plug>ZshCheck')
+ nmap <buffer> <unique>
+ \ <LocalLeader>c
\ <Plug>ZshCheck
- \ :<C-U>call <SID>ZshCheck()<CR>
if exists('b:undo_ftplugin')
let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <Plug>ZshCheck'
- endif
-
- " If there isn't a key mapping already, use a default one
- if !hasmapto('<Plug>ZshCheck')
- nmap <buffer> <unique>
- \ <LocalLeader>c
- \ <Plug>ZshCheck
- if exists('b:undo_ftplugin')
- let b:undo_ftplugin = b:undo_ftplugin
- \ . '|nunmap <buffer> <LocalLeader>c'
- endif
+ \ . '|nunmap <buffer> <LocalLeader>c'
endif
-
endif