Wikia

Vim Tips Wiki

Changes: Restore missing gvim menu bar under GNOME

Edit

Back to page

(Comments)
Line 53: Line 53:
   
 
<li>If deleting <code>~/.gnome2/Vim</code> does not work, check the <code>.vimrc</code> file permission to make sure the current user can read it. If GVim is installed by root, or the .vimrc file is copied from a flash key, its permission may prevent other users from reading it when starting GVim. When that happens all custom settings in .vimrc, including the menu, do not apply, causing the menu not to be shown. --Oct 2013</li>
 
<li>If deleting <code>~/.gnome2/Vim</code> does not work, check the <code>.vimrc</code> file permission to make sure the current user can read it. If GVim is installed by root, or the .vimrc file is copied from a flash key, its permission may prevent other users from reading it when starting GVim. When that happens all custom settings in .vimrc, including the menu, do not apply, causing the menu not to be shown. --Oct 2013</li>
  +
</ul>
  +
  +
==Comments==
  +
  +
<ul>
  +
  +
<li>The disappearance of the menu bar in GVim is not a bug in GNOME; it's deliberate on the contrary, and a clever idea from the developers of the Unity project. The goal is one of optimization : it minimize the footprint on the desktop and maximize the editable surface of the windows opened by GVim. The left part of the global menus bar in Unity hold the "Application Indicators" and act as the GVim's menu bar for the ever sole active window, instead of being needlessly repeated in all the windows.</li>
  +
  +
<li>For the one who prefer not using the mouse, the <code><F10></code> key unroll the leftmost menu of the active window of GVim. Navigation is done within a menu with the up and down arrows, from a menu to the other with the left and right arrows. Selection is done by pressing the <code><Enter></code> key, and escape by pressing <code><Esc></code>.
  +
  +
It worth noting the keyboard shortcuts hints to the right (left for bidirectional languages) of the menus, which hints are hidden in the Unity global menus.
  +
</li>
  +
  +
<li>The head titles of the GVim's menus being fILE, eDIT, tOOLS, sYNTAX, bUFFERS, wINDDOWS and hELP, it yields the mnemonic "fetsbwh" which in turn ease access to any specific menu by pressing keys <code><Alt f></code> for the File menu, <code><Alt e></code> for the Edit menu, and so on up to the Help menu <code><Alt h></code>. Navigation, selection and escape are as usual.</li>
  +
  +
<li>For the one who stick to the GVim's menu bar in the window, start GVim with the terminal command :
  +
<pre>
  +
$ UBUNTU_MENUPROXY="" gvim
  +
</pre>
  +
  +
The variable is usually set to "libappmenu.so" (in /usr/lib/indicators3/7/). Clearing it launch GVim without using Unity global menus. -- Jan 2014</li>
  +
 
</ul>
 
</ul>

Revision as of 03:05, January 10, 2014

Tip 1677 Printable Monobook Previous Next

created September 8, 2011 · complexity basic · version 7.0


What to do if Vim's menu bar disappears due to a bug in GNOME, so that gvim cannot display its menu?

Changing guioptions

The standard method for displaying or hiding the menu bar is to use these commands in gvim:

  • :set guioptions+=m   enable (display) menu bar
  • :set guioptions-=m   disable (hide) menu bar

If you are using Gnome/Metacity, a problem may prevent the menu bar from being displayed: Gnome tries to dock the menu in a place where you cannot see it. A test to see if this is the issue is to open gvim as root (with sudo gvim), then see if the menu can be enabled and disabled using the above commands.

Solution

Open a terminal and enter the command:

rm ~/.gnome2/Vim

and/or:

rm ~/.gnome/Vim

That is, delete the file under your home directory where Gnome keeps its settings for Vim. It will be recreated when you run gvim again. With luck, the menu will be displayed again.

Comments

  • Deleting the file ~/.gnome2/Vim worked, but the problem recurs. Examining this file shows that the problem is that the toolbar and the menubar are overlayed:
    [Placement]
    Dock=Toolbar\\0,0,0,0\\Menubar\\0,0,0,0
    

    Change this to:

    [Placement]
    Dock=Toolbar\\0,1,0,0\\Menubar\\0,0,0,0
    

    This solves the problem. The question however remains, namely how does this file get repeatedly corrupted in the first place. --December 29, 2011

  • If deleting ~/.gnome2/Vim does not work, check the .vimrc file permission to make sure the current user can read it. If GVim is installed by root, or the .vimrc file is copied from a flash key, its permission may prevent other users from reading it when starting GVim. When that happens all custom settings in .vimrc, including the menu, do not apply, causing the menu not to be shown. --Oct 2013

Comments

  • The disappearance of the menu bar in GVim is not a bug in GNOME; it's deliberate on the contrary, and a clever idea from the developers of the Unity project. The goal is one of optimization : it minimize the footprint on the desktop and maximize the editable surface of the windows opened by GVim. The left part of the global menus bar in Unity hold the "Application Indicators" and act as the GVim's menu bar for the ever sole active window, instead of being needlessly repeated in all the windows.
  • For the one who prefer not using the mouse, the <F10> key unroll the leftmost menu of the active window of GVim. Navigation is done within a menu with the up and down arrows, from a menu to the other with the left and right arrows. Selection is done by pressing the <Enter> key, and escape by pressing <Esc>. It worth noting the keyboard shortcuts hints to the right (left for bidirectional languages) of the menus, which hints are hidden in the Unity global menus.
  • The head titles of the GVim's menus being fILE, eDIT, tOOLS, sYNTAX, bUFFERS, wINDDOWS and hELP, it yields the mnemonic "fetsbwh" which in turn ease access to any specific menu by pressing keys <Alt f> for the File menu, <Alt e> for the Edit menu, and so on up to the Help menu <Alt h>. Navigation, selection and escape are as usual.
  • For the one who stick to the GVim's menu bar in the window, start GVim with the terminal command :
    $ UBUNTU_MENUPROXY="" gvim
    
    The variable is usually set to "libappmenu.so" (in /usr/lib/indicators3/7/). Clearing it launch GVim without using Unity global menus. -- Jan 2014

Around Wikia's network

Random Wiki