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?

link|improve this question

80% accept rate
feedback

1 Answer

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.

link|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
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.