Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 tried imap < F9 > :!g++ % - (without spaces), but it doesn't work.

EDITED: So stupid, I wanted to say map < F9 > :!g++ % - without spaces... But I figured out that the spaces are the problem.

share|improve this question
up vote 4 down vote accepted

This should be what you are looking for:

:map <F9> :!g++ %

imap is for ignoring the mapping.

Next time you ask a question please provide more details on how exactly it did not work (what output did it have when you pressed F9? did nothing happen?).

share|improve this answer
This is it, thank you :) – Vlad Tarniceru Apr 6 '13 at 11:04
your welcome :) – Benjamin Kaiser Apr 6 '13 at 11:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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