Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a mapping defined like

noremap <M-n> :tabn<CR>

which works nicely, except in the following scenario: I run :make, I'm waiting while javac is thinking, then I suddenly realize something I should check in another file and try to switch tabs. I cannot do this, since until :make completes I'm still in command mode, and :tabn does not have the desired effect.

Is there any way I can map directly to the action of switching tabs, and not to the keys that would be typed to do so?

share|improve this question
up vote 1 down vote accepted

:map commands only deal with keyboard input, so if Vim is busy waiting for a command to finish, it's not going to respond to a mapping.

If there's some way to make your :make (!) run in the background, then you'd be fine. But Vim isn't particularly multithreaded.

share|improve this answer
Yes, lack of parallelism does seem to be a problem; I can't even switch tabs by clicking on the gui tabs. sigh oh well. Thanks for your answer. – Owen May 28 '11 at 17:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .