I start gvim with this entry in .bashrc
alias G='gvim -fg white -bg black -geom 80x45 '
and have in .vimrc
set guioptions=aeik

which works as expected and gives me a gvim that looks like vim in a tty, except that the 3 lines lost by removing the menu and toolbar are gone, and the remaining geometry is 80x42.

Making the initial geometry 80x48 to compensate does not work as this asks for a window taller than the screen, and apparently is just ignored. How can I get rid of the menu and toolbar and also maximize the window height?

  • 1
    Try setting the guioptions in gvimrc instead (though I don’t actually know if that’s relevant to your problem)
    – D. Ben Knoble
    Jul 30 '20 at 18:50
  • @D.BenKnoble That won't help, .gvimrc is processed after .vimrc, and the problem is the command line is processed first, setting the geometry, and while the guioptions can reduce that geometry, there seems to be no option that preserves the original geometry.
    – user985675
    Aug 1 '20 at 18:02
  • But eliminating the menu/toolbar are usually done in gvimrc precisely because some things (guioptions) are reset when the GUI starts! This happens before processing the gvimrc...
    – D. Ben Knoble
    Aug 1 '20 at 18:56
  • No matter which vim you start, it processes the command line first, then .vimrc, then .gvimrc if it exists. :h startup gives the full sequence of events.
    – user985675
    Aug 2 '20 at 21:23
  • The problem lies in :set lines=45. Turns out you can set my gvim to any number of lines less than 42, but over 41 has no effect
    – user985675
    Aug 2 '20 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.