How to hide the menu/tool bar of gvim?
VimVim 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.
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.
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.
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.