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!
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With