From 7c539e78bb3c6c6efcb6c6799b6147b84b707c60 Mon Sep 17 00:00:00 2001 From: Kabbaj Amine Date: Tue, 20 Mar 2018 17:45:39 +0300 Subject: [PATCH] Maps default keys only when they are not already used --- plugin/zeavim.vim | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/plugin/zeavim.vim b/plugin/zeavim.vim index 0ebca74..0325394 100644 --- a/plugin/zeavim.vim +++ b/plugin/zeavim.vim @@ -2,7 +2,7 @@ " Global plugin that allows executing Zeal from Vim. " Version : 2.3.0 " Creation : 2014-04-14 -" Last Change : 2018-03-12 +" Last Change : 2018-03-20 " Maintainer : Kabbaj Amine " License : This file is placed in the public domain. " ========================================================== @@ -24,16 +24,24 @@ set cpoptions&vim " Default mappings {{{1 if !exists('g:zv_disable_mapping') if !hasmapto('Zeavim') - nmap z Zeavim + if empty(mapcheck('z')) + nmap z Zeavim + endif endif if !hasmapto('ZVVisSelection') - vmap z ZVVisSelection + if empty(mapcheck('z', 'v')) + vmap z ZVVisSelection + endif endif if !hasmapto('ZVKeyDocset') - nmap z ZVKeyDocset + if empty(mapcheck('z')) + nmap z ZVKeyDocset + endif endif if !hasmapto('ZVOperator') - nmap gz ZVOperator + if empty(mapcheck('gz')) + nmap gz ZVOperator + endif endif endif