gvim: how remove menu and toolbar, but keep original geometry

55 views
Skip to first unread message

Graham Lawrence

unread,
Aug 1, 2020, 4:52:18 PM8/1/20
to vim...@googlegroups.com
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?



--
Graham Lawrence

Alessandro Antonello

unread,
Aug 2, 2020, 9:59:25 AM8/2/20
to vim...@googlegroups.com
Hi, Graham
You may set width and height in your .vimrc using:

set columns=80
set lines=45

Your GVim session will resize accordingly.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/CA%2BE5mK6p0x%2Bxwy%3DnofU6O-_S5X5f1X7dKnt9Dd%3DfjcU4uWqEcw%40mail.gmail.com.

Benjamin Esham

unread,
Aug 2, 2020, 10:00:55 AM8/2/20
to vim...@googlegroups.com
You should be able to resize the window after setting 'guioptions' with

set guioptions=aeik
set lines=45

There is a corresponding 'columns' option too, so you might be able to put

set columns=80 lines=45

in your vimrc after setting 'guioptions' and then you wouldn't need the
"-geom" flag in your alias anymore. (If you want different window sizes in
different situations, though, maybe this wouldn't make sense.)

HTH,

Benjamin

Graham Lawrence

unread,
Aug 2, 2020, 2:34:25 PM8/2/20
to vim...@googlegroups.com
Thank you Alessandro Antonelli and Benjamin Esham, but I find that the problem is with :set lines. For any value below 42, I get the number of lines I ask for, but for 42 or more I only get 41 lines.
With the mouse, I can drag the window to 43 lines, but the emergence of the task bar prevents any further enlargement.

Normally, I run vim in an xterm with -geom 80x59, and altering my .vimrc to include set lines=45 instantly resizes the xterm window to 45 lines, but this does not transfer to gvim when I start it, it has only 41. In gvim I can set the number of lines below 42, but not above it.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.


--
Graham Lawrence

meine

unread,
Aug 2, 2020, 5:40:20 PM8/2/20
to vim...@googlegroups.com
> which works as expected and gives me a gvim that looks like vim in a tty,

Just for my curiosity, why don't you use vim in a plain console or plain
terminal window? Is there any advantage in using gvim this way instead
of a plain vim session?

//meine

Benjamin Esham

unread,
Aug 2, 2020, 6:17:07 PM8/2/20
to vim...@googlegroups.com
meine wrote:
Mouse support, maybe? Gvim may also offer a larger color palette, depending
on your terminal.

Benjamin

Graham Lawrence

unread,
Aug 3, 2020, 3:05:55 PM8/3/20
to vim...@googlegroups.com
I do use vim in a terminal, xterm, and find it very satisfactory, with 59 lines of text in view. But that was on Arch Linux, a distro that has many fine features, but whose excruciating install process puts it firmly among the hair-shirt trinity of Linux distros, Arch, Gentoo and Linux from Scratch.
On Lubuntu, I use the same setup, but the ubuntus, and as far as I can determine every other distro except Arch, lack a small font package that enables xterm to show the full range of the utf-8 character set. Without it xterm issues the following complaint whenever it starts with vim:

xterm: cannot load font "-Misc-Fixed-bold-R-*-*-13-120-75-75-C-60-ISO8859-1"
xterm: cannot load font "-Misc-Fixed-medium-R-*-*-13-120-75-75-C-120-ISO10646-1"
xterm: cannot load font "-Misc-Fixed-bold-R-*-*-13-120-75-75-C-120-ISO10646-1"
xterm: cannot load font "-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1"

and will show essentially only the keyboard characters, all others as blanks.

Gvim doesn't have that problem, but, being a hard-core keyboard user I don't wish to be lured into unnatural practices with rodents and (oh horrors!) menus.

I guess what I have to do is compile vim for myself.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.


--
Graham Lawrence

meine

unread,
Aug 3, 2020, 3:58:50 PM8/3/20
to vim...@googlegroups.com
On Mon, Aug 03, 2020 at 12:05:34PM -0700, Graham Lawrence wrote:
> xterm: cannot load font

TNX for your explanations Benjamin, Graham! Never really realized the
sometimes limited fonts and colours in a basic terminal window. Indeed
my tty CLI only has 16 colours and gvim probably has the entire palette.
The less colours and frills the better for me, keeps me concentrated on
writing.

Since I use the Danish/German accented characters only as html coded in
my text documents, getting them on screen isn't an issue for me (have to
try the LaTeX ligatures etc for that and see how it works).

//meine

John Little

unread,
Aug 3, 2020, 6:35:18 PM8/3/20
to vim_use

> except that the 3 lines lost by removing the menu and toolbar are gone, and the remaining geometry is 80x42.

On my KDE I get the behaviour you want.  What's your DE? 

Also, in case there's something in your set up, f.ex. something in the .vimrc which triggers the GUI to start before the setting of guioptions, try

    gvim --clean --cmd 'set go=aeik' -geom 80x80

If that works, you could move stuff around in the .vimrc and .gvimrc to find the cause.  Or, maybe put the set go in the alias.  I get your issue if I use :set lines= after gvim starts.

In KDE, I can force the size of gvim window, and make it larger than the screen, but having forced the size, it can't be changed subsequently.

Regards, and HTH, John Little

Graham Lawrence

unread,
Aug 4, 2020, 1:30:43 PM8/4/20
to vim...@googlegroups.com
Thanks for your help, John, but no luck, I get the same behavior. My DE is called LXDE, I believe, with Openbox the WM.
I was thinking maybe Lubuntu's gvim is compiled to have no more than 42 lines, in which case I'll just live with it, keep using vim in xterm and only use gvim when I need to be able to see the full utf-8 character set.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.


--
Graham Lawrence
Reply all
Reply to author
Forward
0 new messages