vim-rsi icon indicating copy to clipboard operation
vim-rsi copied to clipboard

Don't map Insert mode meta chords during macro

Open djjcast opened this issue 10 years ago • 2 comments

Here's a potential fix for issue #13. To test the fix, edit a file with the following contents:

foo
foo
foo
foo
foo
foo
foo

Then search/foo<CR>, record a macro ggqqciwbar<Esc>nq, and execute the macro a few times 4@q. The important part of the macro that's being tested is the <Esc>n sequence, which vim-rsi remaps.

djjcast avatar Dec 12 '15 23:12 djjcast

I think anything this dicey should probably just be made into a separate, general purpose plugin, no? RSI continues to provide <M-b> and the like but drops the escape code shenanigans, and the new plugin delegates all 26 letters or so.

tpope avatar Dec 13 '15 02:12 tpope

Sure, I can see this being a separate plugin. Feel free to use and refactor the code however you think is best.

Yeah, it's a dicey hack but seems to work consistently. I'm not sure why we have to use cnoremap <buffer><nowait> <Esc> <C-c> instead of cnoremap <buffer><nowait> <Esc> <Esc>; the latter mapping causes <Esc> to always behave like the x flag is set in cpoptions for some reason.

djjcast avatar Dec 13 '15 03:12 djjcast