From 00b3dd0274651be8805a3033ff7fa9662f342a23 Mon Sep 17 00:00:00 2001 From: Micha Moskovic Date: Tue, 10 Dec 2013 17:43:08 +0100 Subject: [PATCH] Make the default mappings optional --- doc/exchange.txt | 11 +++++++++++ plugin/exchange.vim | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/doc/exchange.txt b/doc/exchange.txt index fa9e174..5d7bbcc 100644 --- a/doc/exchange.txt +++ b/doc/exchange.txt @@ -45,6 +45,17 @@ text will the be changed to: It should be noted that I don't actually go by that nickname. +SETTINGS *exchange-settings* + +*g:exchange_no_mappings* + If this variable is defined, the default keyboard mappings will not be + loaded. You are then free to define your own. + The default mappings are + nmap cx Exchange + vmap cx Exchange + nmap cxc ExchangeClear + nmap cxx ExchangeLine + ISSUES AND TODO *lion-issues* *lion-todo* See https://github.com/tommcdo/vim-exchange/issues for bugs and issues. diff --git a/plugin/exchange.vim b/plugin/exchange.vim index 7414fa0..ea50581 100644 --- a/plugin/exchange.vim +++ b/plugin/exchange.vim @@ -110,6 +110,10 @@ vnoremap Exchange :call exchange_set(visualmode(), 1) ExchangeClear :call exchange_clear() nnoremap ExchangeLine :set opfunc=exchange_setg@_ +if exists('g:exchange_no_mappings') + finish +endif + nmap cx Exchange vmap cx Exchange nmap cxc ExchangeClear