aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2017-04-29 07:43:02 +0200
committerTeddy Wing2017-04-29 07:43:02 +0200
commit58eb3fe8a2a26ad6a6bdfba7781cc69fc777b3f8 (patch)
tree92102bd35af183b31345278c7819f3e766697f60
parent3950864bd41ce990278ac3a5627f785e1d6e4750 (diff)
downloadvim-gitcha-58eb3fe8a2a26ad6a6bdfba7781cc69fc777b3f8.tar.bz2
ftplugin/gitcommit: Cleaner `if` condition
Clean up the check for `g:no_plugin_maps` based on this style from tpope's gitrebase.vim: https://github.com/tpope/vim-git/blob/5fcaf2b4f66cd28984cf4fe814d7803bbf073a12/ftplugin/gitrebase.vim
-rw-r--r--ftplugin/gitcommit/gitcha.vim12
1 files changed, 7 insertions, 5 deletions
diff --git a/ftplugin/gitcommit/gitcha.vim b/ftplugin/gitcommit/gitcha.vim
index 43c4f23..aaa6c1a 100644
--- a/ftplugin/gitcommit/gitcha.vim
+++ b/ftplugin/gitcommit/gitcha.vim
@@ -1,9 +1,11 @@
-if !exists('g:no_plugin_maps') && !exists('g:no_gitcha_maps')
- if !hasmapto('<Plug>GitchaCompleteSHA')
- imap <buffer> <C-x><C-s> <Plug>GitchaCompleteSHA
- endif
+if exists('g:no_plugin_maps') || exists('g:no_gitcha_maps')
+ finish
+endif
- inoremap <buffer> <expr> <Plug>GitchaCompleteSHA gitcha#StartGitSHACompletion()
+if !hasmapto('<Plug>GitchaCompleteSHA')
+ imap <buffer> <C-x><C-s> <Plug>GitchaCompleteSHA
endif
+inoremap <buffer> <expr> <Plug>GitchaCompleteSHA gitcha#StartGitSHACompletion()
+
let b:undo_ftplugin = 'iunmap <buffer> <C-x><C-s>'