How to hide the menu/tool bar of gvim?

前端 未结 7 803
刺人心
刺人心 2020-12-12 18:42

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.

相关标签:
7条回答
  • 2020-12-12 19:21

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

    set guioptions-=m  "menu bar
    set guioptions-=T  "toolbar
    set guioptions-=r  "scrollbar
    
    0 讨论(0)
  • 2020-12-12 19:25

    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.

    0 讨论(0)
  • 2020-12-12 19:29
    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.

    0 讨论(0)
  • 2020-12-12 19:32

    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.

    0 讨论(0)
  • 2020-12-12 19:37

    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.

    0 讨论(0)
  • 2020-12-12 19:45

    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.

    0 讨论(0)
提交回复
热议问题