1
map <Alt>q <Esc>la

This line in my vimrc seems not working after the Esc key. It do exits the insert mode but doesn't enter insert mode again. I also tried

inoremap <Alt>q <Esc>la
map <Alt>q <Esc><Ctrl-A>
map <Alt>q <Esc><Ctrl>A

Basically I want to have something within the normal typing position to have the same effect as key. Say

(i>5[cursor]) 
->
(i>5)[cursor]

Solution:

I figured out the problem. Its cuz my terminal doesn't properly recognize alt as the alt, instead as a system level alt somehow. see

Alt key shortcuts not working on gnome terminal with Vim

Community
  • 1
  • 1
Bobby
  • 1,511
  • 1
  • 15
  • 24

1 Answers1

4

As far as I can see there are two problems:

  1. <Alt> isn't a thing. If you want to map Alt+q, that's <M-q>.
  2. :map doesn't apply to insert mode.

You haven't explained what you're trying to do, so I can't tell you what to do instead.

melpomene
  • 84,125
  • 8
  • 85
  • 148
  • thanks! It worked after some inspiration from you! Although not the exact problem but helped :) – Bobby Jan 09 '17 at 13:53