I'm a Windows guy who recently switched to Ubuntu ... I use gVim for programming. Every time I launch gVim from the applications menu or from the right-click context menu, it opens in workspace #4, no matter what workspace I'm in (usually I'm just in #1, still getting used to that concept).

If I run gvim from a terminal, it stays in the same workspace, so I'm guessing this has something to do with the Unity desktop (?) How can I make gVim open in the current workspace?

  • 4
    I can't reproduce this. Have you experimented with anything like wmctrl or devilspie by any chance? Just asking, because those programs can control window placement like that. Also, do you have a custom gvim desktop file under ~/.local/share/applications/ ? – geirha Mar 3 '12 at 16:39
  • No haven't used either of those, and don't have a custom desktop file there. Just the regular _vimrc file. But your comment made think of running gVim without anything in _vimrc, and guess what, when I do that it opens in the current workspace. I'll go through and see if I can isolate what was causing it. – Eugene M Mar 3 '12 at 21:57

You do not have to pass on maximized windows.

I do it the following way to have a maximized window in the current workspace:

function! MaximizeWindow()
  set lines=999
  set columns=999

autocmd GUIEnter * :call MaximizeWindow()
| improve this answer | |

OK, this was the culprit in the _vimrc file:

set lines=999
set columns=999

Thanks @geirha for your help.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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