secluded
secluded

Reputation: 517

What's wrong with this remapping?

I want to define a mapping that takes the cursor to the end of the line and inserts a semicolon there. I have put this in the .vimrc file:

inoremap aa <ESC>A;<ESC>

it works fine in the insert mode but doesn't work in the normal mode!! Please explain why this is happening and what can be done so that it also works in the normal mode. Thanks in advance!

Upvotes: 2

Views: 141

Answers (1)

To make it work for normal mode also you need to add this mapping:

nnoremap aa A;<ESC>

  • inoremap means insert mode mapping

  • vnoremap means visual mode mapping

  • nnoremap means normal mode mapping

  • cnoremap means command mode mapping

  • noremap means visual, normal & Operator-pending modes mapping

For others you can check them by executing :help noremap

Upvotes: 10

Related Questions