Hide toolbar
From Vim Tips Wiki
Tip 259 Previous Next Created: June 12, 2002 Complexity: basic Author: Ali Rizvi Version: 6.0
Here is how to remove the toolbar from gvim, if you don't use it.
In your gvimrc include the following two lines:
unmenu ToolBar unmenu! ToolBar
Doing this from an open gvim does not remove them but grays them out but doing from gvimrc does the job.
[edit] Comments
The correct procedure to hide the toolbar is:
:set guioptions-=T
Similarly,
:set guioptions-=m
or -=M (more extreme solution, I think) works quite well for hiding the menus.
See :help 'guioptions'.
As I posted in another thread on hiding the toolbar, this will make the toolbar/menu toggleable:
set guioptions-=T "get rid of toolbar :let g:toggleTool = 0 map <silent> <S-F1> :if g:toggleTool == 1<CR>:set guioptions-=T<CR>:let g:toggleTool = 0<CR>:else<CR>:set guioptions+=T<CR>:let g:toggleTool = 1<CR>:endif<CR> set guioptions-=m "get rid of menu :let g:toggleMenu = 0 map <silent> <S-F2> :if g:toggleMenu == 1<CR>:set guioptions-=m<CR>:let g:toggleMenu = 0<CR>:else<CR>:set guioptions+=m<CR>:let g:toggleMenu = 1<CR>:endif<CR>
Just wanted to add that removing the toolbars and the menu improves responsiveness when using gvim under X11 over a remote connection. For some reason certain operations (like say :diffupdate) causes the X11 server to spend huge amounts of time refreshing the toolbars and the menus over a remote connection.
I found that toggling the menubar using Tom's script (above) ate up one line each time (using Andale Mono font). Below is a modified version of that script which adjusts the number of lines displayed as the menubar and toolbar are toggled, keeping the GVim window at a more uniform size.
" get rid of menu set guioptions-=m :let g:toggleMenu = 0 map <silent> <S-F1> :if g:toggleMenu == 1<CR>:set guioptions-=m<CR>:set lines+=1<CR>:let g:toggleMenu = 0<CR>:else<CR>:set guioptions+=m<CR>:let g:toggleMenu = 1<CR>:endif<CR> " get rid of toolbar set guioptions-=T :let g:toggleTool = 0 map <silent> <S-F2> :if g:toggleTool == 1<CR>:set guioptions-=T<CR>:set lines+=3<CR>:let g:toggleTool = 0<CR>:else<CR>:set lines-=3<CR>:set guioptions+=T<CR>:let g:toggleTool = 1<CR>:endif<CR>
I added this to your very usefull commands (not sure if the setlines are usefull...): to show or hide the tabs
" open all buffer in tabs/close all tabs :let g:toggleTabs = 0 map <S-F3> :tab ball<CR> map <silent><S-F3> :if g:toggleTabs == 1<CR>:tabo<CR>:set lines+=3<CR>:let g:toggleTabs = 0<CR>:else<CR>:set lines-=3<CR>:tab ball<CR>:let g:toggleTabs = 1<CR>:endif<CR>
