How to hide the menu/tool bar of gvim?

Vim

Vim Problem Overview


I don't have use for the menu and tools bars in gvim on Windows; Can I hide them?

This will give more space to the text area.

enter image description here

Vim Solutions


Solution 1 - Vim

Use the guioptions setting (abbreviated as go).

:set guioptions -=m 

Removes the menu bar.

:set guioptions -=T

Removes the toolbar.

My reference

Solution 2 - Vim

you can hide it by typing these command in your .vimrc

set guioptions-=m  "menu bar
set guioptions-=T  "toolbar
set guioptions-=r  "scrollbar

Solution 3 - Vim

I have the following code in my .vimrc : by default the bar is hidden, but if I want to display it I can use F11 to toggle between the two modes.

function! ToggleGUICruft()
  if &guioptions=='i'
    exec('set guioptions=imTrL')
  else
    exec('set guioptions=i')
  endif
endfunction

map <F11> <Esc>:call ToggleGUICruft()<cr>

" by default, hide gui menus
set guioptions=i

Removing mTrl hides the window menu bar, task bar and right scroll bar, it is kind of a Gvim fullscreen mode. See :help guioptions for more information and customization.

PS : it is important to keep i in your guioptions, otherwise the Vim Icon is not displayed in AltTAB and task bar.

Solution 4 - Vim

You can select Edit -> Global settings -> Toggle toolbar. This hides toolbar until you restart VIM. Then, enter :set. Vim prompt you list of different options, find line containing guioptions. This is what you need to add to .vimrc file to sustain this appearance.

This method can be used if you don't know option name but know how to change it through main menu.

Solution 5 - Vim

I have

set guioptions=

in my .vimrc. But too often I wanted to use the menu momentarily with :set go+=m and :set go-=m.

From Hide toolbar or menus to see more text - Vim Tips Wiki, I use their

let mapleader=","
nnoremap <leader>m :if &go=~#'m'<Bar>set go-=m<Bar>else<Bar>set go+=m<Bar>endif<CR>

to toggle menu on and off with ,m. (Well, they actually have ctrl-F1 as the key-binding.)

For instance, when I need to remember the way to paste from OS' clipboard, I can find it in the menu very quickly. Once found, I'll still type it manually with "+gP to build muscle memory, but still I use it so seldom that I forget it too quickly.

Solution 6 - Vim

set go=c

> Use console dialogs instead of popup dialogs for simple choices.

I think this will turn it off, not just hiding it.

http://vimdoc.sourceforge.net/htmldoc/options.html#%27go-c%27

Edit: Just to clarify, this turning off the menus and toolbars in a GUI as well.

enter image description here

Solution 7 - Vim

The gVim shipping with Fedora (not sure if other distributions are effected) has a bug that doesn't allow you to remove the menu with set go-=m; for some reason, the "m" option isn't in the "go" string until you set it. So the .vimrc command sequence that removes the menu bar on startup in Fedora (tested in 26) is:

set go=agitm
set go-=m

I couln't find a solution anywhere else, so hopefully that helps someone else using gVim on Fedora.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionzddView Question on Stackoverflow
Solution 1 - Vimhd1View Answer on Stackoverflow
Solution 2 - VimphschoenView Answer on Stackoverflow
Solution 3 - VimXavier T.View Answer on Stackoverflow
Solution 4 - VimEvgeny LazinView Answer on Stackoverflow
Solution 5 - VimBrady TrainorView Answer on Stackoverflow
Solution 6 - VimLantiView Answer on Stackoverflow
Solution 7 - VimtdehrView Answer on Stackoverflow