Make the default mappings optional

This commit is contained in:
Micha Moskovic 2013-12-10 17:43:08 +01:00
parent ae6495dafc
commit 00b3dd0274
2 changed files with 15 additions and 0 deletions

View File

@ -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 <Plug>Exchange
vmap cx <Plug>Exchange
nmap cxc <Plug>ExchangeClear
nmap cxx <Plug>ExchangeLine
ISSUES AND TODO *lion-issues* *lion-todo*
See https://github.com/tommcdo/vim-exchange/issues for bugs and issues.

View File

@ -110,6 +110,10 @@ vnoremap <silent> <Plug>Exchange :<C-u>call <SID>exchange_set(visualmode(), 1)<C
nnoremap <silent> <Plug>ExchangeClear :<C-u>call <SID>exchange_clear()<CR>
nnoremap <silent> <Plug>ExchangeLine :<C-u>set opfunc=<SID>exchange_set<CR>g@_
if exists('g:exchange_no_mappings')
finish
endif
nmap cx <Plug>Exchange
vmap cx <Plug>Exchange
nmap cxc <Plug>ExchangeClear