diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-16 21:59:31 +1200 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-06-16 21:59:31 +1200 |
commit | 88defc4fc528bad2b0664c634d95e4363665472d (patch) | |
tree | 333f2a15365563c5af18e92fa331de0190ae9046 /vim/after/ftplugin/zsh | |
parent | Correct g:current_compiler setting (diff) | |
download | dotfiles-88defc4fc528bad2b0664c634d95e4363665472d.tar.gz dotfiles-88defc4fc528bad2b0664c634d95e4363665472d.zip |
Use short-circuit for no-mapping check
Diffstat (limited to 'vim/after/ftplugin/zsh')
-rw-r--r-- | vim/after/ftplugin/zsh/check.vim | 34 |
1 files changed, 17 insertions, 17 deletions
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 |