3

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.

2
  • 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, 2011 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, 2011 at 11:07

2 Answers 2

2

Try:

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.

1

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.

3
  • Unfortunately, that doesn't seem to do anything. Also, the --screen option doesn't show up in gvim's man page...
    – jqno
    Jun 15, 2011 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, 2011 at 15:08
  • Not sure why --screen doesn't work for me, but -geom does. Thanks!
    – jqno
    Jun 16, 2011 at 11:06

You must log in to answer this question.

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