tommcdo / vim-exchange

Easy text exchange operator for Vim
MIT License
756 stars 23 forks source link

'cxx' / 'cX' incorrectly mapped to Visual mode and not Visual-Line mode? #12

Closed jwmann closed 10 years ago

jwmann commented 10 years ago

Checking my :vmap I see that cxx and cX is mapped to Visual mode. I also see that it calls the <Plug>ExchangeLine function

I feel as though this type of Exchange would be more appropriate for 'Visual-Line' (V-Line) Mode since it deals with exchanging with lines of code.

If I recall correctly (I could be wrong) but this Visual-Line mode mapping uses lmap

As a side note. I had to remap cxx and cX in order to avoid the sluggish 'c' issue shown here - https://github.com/tommcdo/vim-exchange/issues/11

These were the mappings I used.

" Re-Map the visual exchange capability in order to avoid a 'slugish'
" 'c' command in visual mode
" https://github.com/tommcdo/vim-exchange/issues/11
vmap <leader>cx <Plug>Exchange
vmap <leader>cxx <Plug>ExchangeLine
vmap <leader>cX <Plug>ExchangeLine

I never knew about the cxx / cX capability prior to this so unfortunately I'm not sure how well these commands perform since I've remapped them.

Please let me know what your thoughts on this are.

tommcdo commented 10 years ago

Oops. cxx is supposed to be a normal mode mapping. (It was before my latest commit -- when I changed how I assign mappings, I made a small mistake.) It's like dd or gUU; the normal mode linewise version of the operator.

tommcdo commented 10 years ago

There shouldn't be a mapping to cX by default, though... not sure what's going on there. Unless you followed the remapping example in the help?

jwmann commented 10 years ago

@tommcdo Yes I followed the example from the Help.