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

Gvim has the -f option. Its man page says,

-f Foreground.    For  the  GUI  version, Vim will not fork and
                  detach from the shell it was started in.

What does this mean?

I encountered this option when trying to make the global menu work for gvim from How to get global application menu for gvim?.

I thought it would be that gvim -f file & would show gvim and gvim file & wouldn't. But they both seem to have same behavior.

share|improve this question
up vote 1 down vote accepted

The difference should be more apparent if you try it from a terminal without the ampersands. By default, gvim goes into the background so the user can run other commands, but -f makes it wait till the editor window closes.

share|improve this answer
I do not observe this behavior. I can execute other commands from terminal while running gvim -f file. Maybe you can be more explicit? – StuartHa Jun 12 '13 at 20:45
@Stuart, do you have an alias for gvim? what does type -a gvim tell you? – glenn jackman Jun 12 '13 at 21:11
-1 for me, you're right, my alias was blocking it. – StuartHa Jun 12 '13 at 21:59

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.