4

So, trying to get up to speed with LaTex in vim/gvim... problem is the beginners tutorial for vim-latexsuite assumes gvim and the gui menus. Okay, got gvim right here. Problem is, under Unity and the global app menu, the menus are truncated and don't show the keyboard shortcuts that they should for most entries, or in the case of the TeX-Suite menus, entries like '2: Article' are simply truncated to '2: '. Not helpful at all!

I know the menus themselves work - starting gvim using sudo gvim, which does not use the global app menu but the local menus, looks just fine - like gvim on any other platform or desktop, i.e. like it should.

How do I force that behaviour under Unity for a regular user (i.e. not using sudo)?

2
  • See updated answer, @Braiam suggested a much better and simpler approach.
    – terdon
    Mar 14, 2014 at 0:36
  • And @Braiam saved the day again, see updated answer for how to get it to work graphically.
    – terdon
    Mar 14, 2014 at 2:03

1 Answer 1

4

This should work (thanks @Braiam):

 UBUNTU_MENUPROXY=0 gvim

Running the above command from a terminal will launch a gvim instance with its own menus. So, to create a launcher on your desktop, open a file called ~/Desktop/gvim.desktop with the following contents:

    [Desktop Entry]
    Name=gvim
    Comment=Run gvim with menus
    Exec=env UBUNTU_MENUPROXY=0 gvim
    Type=Application
    Icon=/usr/share/icons/HighContrast/48x48/apps/vim.png
    StartupNotify=true
    Categories=Utility;Editor;

The env command allows you to run a specific command in a temporarily modified environment and is needed to pass the variable when you launch a program using a .desktop file.

If you prefer the command line way, you now make an alias for the command above by adding this line to your ~/.bashrc:

alias gvim="UBUNTU_MENUPROXY=0 gvim"

Now, open a new terminal, run gvim and you'll have it menu free.

14
  • Since I'm effectively the only user on this machine, I skipped the bit with editing /etc/sudoers but otherwise it worked great. Its unfortunate that Ubuntu/Unity insists on 'dumbing down' the menus in various apps like this...
    – memilanuk
    Mar 13, 2014 at 6:53
  • @memilanuk the sudoers thing is just so you can run it without having to enter a password, nothing to do with other users, just you. And yes, Unity is far from my preferred desktop environment.
    – terdon
    Mar 13, 2014 at 6:56
  • I'd gotten to like XFCE quite a bit in 12.04 and 12.10... but on this laptop (new around then), some of the Fn keys didn't work quite right in Xubuntu and did in Ubuntu/Unity for some reason. Kind of wanting to migrate back to Xubuntu; tried installing xubuntu-desktop but it didn't work. I think when Xubuntu 14.04LTS comes out I'll do a fresh install and call it good for the remaining life of the machine (another couple years at least - I hope).
    – memilanuk
    Mar 13, 2014 at 8:44
  • @memilanuk don't forget you can install any desktop environment you want. There is no reason to use unity if you don't want to.
    – terdon
    Mar 13, 2014 at 15:10
  • Why does sudo help here? I guess because it almost clears the environment? What environment variable is the culprit — env -u DBUS_SESSION_BUS_ADDRESS gvim perhaps? Mar 13, 2014 at 19:40

You must log in to answer this question.

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