0

I remapped vv to <esc>

inoremap vv <esc> "some notes
cnoremap vv <esc>

When using a macro, it can't be repeated. For example: qaifind^Mvvq,then @a and @@ works fine but 2@@ doesn't work.`

:registers a
a:ifind^Mvv

If I use actual <esc>, the macro works for example: qaifind^M<ctrl>[q

:registers a
a:ifind^M<ctrl>[

Is there someting I can do to make vv work in this situation?

3
  • 1
    I tried it exactly as you describe and had no issues. Perhaps try it with known, sane configuration by starting vim with flag --clean and/or try it without plugins using flag --noplugin.
    – B Layer
    Nov 23 at 4:54
  • Welcome to Vi and Vim! Do you happen to have other imaps that start with v or with vv? What does :imap v show you?
    – filbranden
    Nov 23 at 22:57
  • 1
    I try to repeat this in another system but I can't repeat it. And use the flag --clean it happened but --noplugin nothing happened. I'll try to find the answer. Thanks.
    – sam han
    Nov 25 at 2:35
0
inoremap vv <esc> 
cnoremap vv <esc>

would be fine.

The notes version have no other influence, but the Marco can't repeat. It's weird and I don't know the mechanism.

inoremap vv <esc> "some notes
2
  • 1
    You cannot add notes after your mapping. They are seen as argument to the map command. See here in the documentation: github.com/vim/vim/blob/… Nov 25 at 8:01
  • Thanks. I only note in this mapping, so I didn't realize it.
    – sam han
    Nov 25 at 10:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.