Skip to content

Don't map Insert mode meta chords during macro #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

djjcast
Copy link

@djjcast djjcast commented Dec 12, 2015

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.

Closes tpope#13

The CursorHoldI event isn't triggered during macro execution, even when
updatetime is set to zero. We can use this 'feature' to create mappings
on the CursorHoldI event only when the user manually enters Insert mode.
@tpope
Copy link
Owner

tpope commented Dec 13, 2015

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.

@djjcast
Copy link
Author

djjcast commented Dec 13, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants