Change <Plug> mappings to avoid prefix strings

Any custom mappings to <Plug>Exchange, <Plug>ExchangeLine, or
<Plug>ExchangeClear will have to be changed to map to <Plug>(Exchange),
<Plug>(ExchangeLine), and <Plug>(ExchangeClear).

References #12
This commit is contained in:
Tom McDonald 2013-12-22 10:05:38 -05:00
parent 88bb271e2d
commit 80f24f2398
3 changed files with 14 additions and 14 deletions

View File

@ -56,7 +56,7 @@ Set `'timeoutlen'` to a smaller value so that the delay is less noticeable.
Change the default visual mapping to something that doesn't begin with `c` (or
any other existing operator).
vmap <Leader>cx <Plug>Exchange
vmap <Leader>cx <Plug>(Exchange)
[iss11]: https://github.com/tommcdo/vim-exchange/issues/11
[timeoutlen]: http://vimdoc.sourceforge.net/htmldoc/options.html#'timeoutlen'

View File

@ -51,14 +51,14 @@ SETTINGS *exchange-settings*
To change the default mappings, simply provide your own mappings to the
commands below. The default mappings are as follows:
nmap cx <Plug>Exchange
vmap cx <Plug>Exchange
nmap cxc <Plug>ExchangeClear
nmap cxx <Plug>ExchangeLine
nmap cx <Plug>(Exchange)
vmap cx <Plug>(Exchange)
nmap cxc <Plug>(ExchangeClear)
nmap cxx <Plug>(ExchangeLine)
For example, to change the mapping for exchanging a line, use the following:
nmap cX <Plug>ExchangeLine
nmap cX <Plug>(ExchangeLine)
This will use the mapping `cX`, and the default `cxx` will not be mapped.

View File

@ -135,16 +135,16 @@ function! s:create_map(mode, lhs, rhs)
endif
endfunction
nnoremap <silent> <Plug>Exchange :<C-u>set opfunc=<SID>exchange_set<CR>g@
vnoremap <silent> <Plug>Exchange :<C-u>call <SID>exchange_set(visualmode(), 1)<CR>
nnoremap <silent> <Plug>ExchangeClear :<C-u>call <SID>exchange_clear()<CR>
nnoremap <silent> <Plug>ExchangeLine :<C-u>set opfunc=<SID>exchange_set<CR>g@_
nnoremap <silent> <Plug>(Exchange) :<C-u>set opfunc=<SID>exchange_set<CR>g@
vnoremap <silent> <Plug>(Exchange) :<C-u>call <SID>exchange_set(visualmode(), 1)<CR>
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
call s:create_map('n', 'cx', '<Plug>Exchange')
call s:create_map('v', 'cx', '<Plug>Exchange')
call s:create_map('n', 'cxc', '<Plug>ExchangeClear')
call s:create_map('n', 'cxx', '<Plug>ExchangeLine')
call s:create_map('n', 'cx', '<Plug>(Exchange)')
call s:create_map('v', 'cx', '<Plug>(Exchange)')
call s:create_map('n', 'cxc', '<Plug>(ExchangeClear)')
call s:create_map('n', 'cxx', '<Plug>(ExchangeLine)')