Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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'm running Ubuntu 10.04 LTS with a dual screen setup. I have a launcher in my panel that starts up VIM, and I always want it to start on the right monitor. Is there something that I can add to the command line in the launcher to make that happen? Either a VIM parameter, or some other non-VIM-specific trick?

Note that I don't want all instances of VIM to launch to the right monitor. For instance, if I start it from a terminal, I prefer to have it on the left, or whatever monitor my terminal was on.

EDIT FWIW, I'm using GNOME, currently on version 2.30.2.

share|improve this question
What WM are you using? Compiz has the "Place Windows" plugin that will force a certain app to open on a certain screen. Metacity may have something similar. – frabjous Jun 15 '11 at 16:00
I have Compiz. I've thought of it, but then it would be hard to make sure only the VIM from my launcher goes to the right monitor, and the other VIMs don't. – jqno Jun 16 '11 at 11:07
up vote 1 down vote accepted


gvim -c "winpos 1600 0"

where, e.g., 1600 is the pixel width of the left monitor. This should make it start on the first pixel of the right monitor. See :help winpos in vim for more info.

share|improve this answer

You can try the '--screen=X' option.

For Example: gvim --screen=1

You can also try something like 'gvim -geom 100x100+1000'. This will set the dimension and position of gvim window.

share|improve this answer
Unfortunately, that doesn't seem to do anything. Also, the --screen option doesn't show up in gvim's man page... – jqno Jun 15 '11 at 14:18
Yes, because this is a X option and not part of vim. Maybe you have a nvidia card in TwinView mode? So, your X Server recognise your monitors only as one big monitor. – hewo Jun 15 '11 at 15:08
Not sure why --screen doesn't work for me, but -geom does. Thanks! – jqno Jun 16 '11 at 11:06

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.