简体   繁体   中英

Resize gvim window when the font changes

I have a laptop attached to a 1440p screen. Depending on which screen I'm using, I find myself adjusting gvim's font size often. When I do, the number of lines in the window remains the same. I'm also using a tiling window manager, so gvim is always running in a window of a fixed size. The result of this is that increasing the font pushes the status line out of the visible window and decreasing the font leaves me with dead space.

The workaround I've found so far is to open and close a terminal. Resizing gvim forces it to recalculate how much space window it has to draw in. Is there a way to trigger that effect without spawning another window?

Ok, I have a stupid hack that works around the problem. I'm not going to accept my own answer here because this is a question about gvim, but in case anyone else bumps into this thread before it gets a legit answer, here's my hack.

  silent !xterm -e sleep .1;exit

I just dumped that in my font resizing command, which is bound to + and -.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM