1

I have my colon key remapped to switch with semicolon using both nnoremap and vnoremap. This works fine except when I want to repeat the last command line with @:.

Unfortunately, the remapping does not work when doing this, so I have to type Shift-@ and Shift-: instead of just Shift-@ :

Why is the remapping not working in this context?

  • 1
    Well, just keep the shift key held down when you hit the other keys. IMO that's easier than typing @; If not just remap @; . – Antony Jun 26 '16 at 12:48
2

You have to remap @: as well:

nnoremap @; @:

You might as well remap q: while you're at it:

nnoremap q; q:
  • What does 'q:' do? I though q was unbound. – Tyler Durden Jun 26 '16 at 14:22
  • 1
    q: opens the command-line window, where the command line can be edited just like editing text in any window. See :help cmdline-window, :help q: and :help E119 for details. – Jair López Jun 26 '16 at 14:29
  • @TylerDurden q is not unbound. It's a prefix for recording macros and opening command line editing. – Tommy A Jun 26 '16 at 14:49
  • This web page says it is unbound: hea-www.harvard.edu/~fine/Tech/vi.html – Tyler Durden Jun 26 '16 at 14:50
  • It also says that v, V, and K are unbound. Maybe it's talking about original vi? Read :help normal-index, :help insert-index, and :help visual-index if you want to see all of the keys. – Tommy A Jun 26 '16 at 14: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.