From 58eb3fe8a2a26ad6a6bdfba7781cc69fc777b3f8 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Sat, 29 Apr 2017 07:43:02 +0200 Subject: 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 --- ftplugin/gitcommit/gitcha.vim | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'ftplugin') 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('GitchaCompleteSHA') - imap GitchaCompleteSHA - endif +if exists('g:no_plugin_maps') || exists('g:no_gitcha_maps') + finish +endif - inoremap GitchaCompleteSHA gitcha#StartGitSHACompletion() +if !hasmapto('GitchaCompleteSHA') + imap GitchaCompleteSHA endif +inoremap GitchaCompleteSHA gitcha#StartGitSHACompletion() + let b:undo_ftplugin = 'iunmap ' -- cgit v1.2.3