Home > System Tutorial > LINUX > I'm running gVim7.3.1 on a GNU/machine

I'm running gVim7.3.1 on a GNU/machine

王林
Release: 2024-02-09 11:45:12
forward
396 people have browsed it

I'm running gVim7.3 on a GNU/machine. I would like to know if there is a way to manually change the font according to the size of the window. I am relatively new to VimLinux system modification command line font size, so I am new to Vim It's not familiar.

My situation is this: I use DejaVuSansMono12 as my default font, but sometimes I want to switch to Terminus9linux system to modify the command line font size, when I want to shrink the Vim window to see on the screen of content as I type. (You know, for those of us with small laptop screens who don’t want to switch between workspaces…!)

linux系统修改命令行字体大小_linux命令行字体调大_linux字体变大命令

So I want to know if I shrink the commands in the .vimrc file, if I shrink the default window size to small enough that Vim will manually adjust the font, will these behaviors happen manually.

linux命令行字体调大_linux字体变大命令_linux系统修改命令行字体大小

Any comments?

linux字体变大命令_linux系统修改命令行字体大小_linux命令行字体调大

When Vim's window size changes, Vim will trigger a VimResized storm. You can compile an autocmd that adapts to the font ('guifont'). This is an autocmd that only considers "columns" (not "rows" ”) and have a hardcoded font name:

linux命令行字体调大_linux系统修改命令行字体大小_linux字体变大命令

function! FontChangeOnResize()
if &columns > 80
set guifont=Lucida_Console:h14
elseif &columns > 60
set guifont=Lucida_Console:h12
elseif &columns > 40
set guifont=Lucida_Console:h10
elseif &columns > 20
set guifont=Lucida_Console:h8
else
set guifont=Lucida_Console:h6
endif
endfunction
autocmd VimResized * call FontChangeOnResize()
Copy after login

The above is the detailed content of I'm running gVim7.3.1 on a GNU/machine. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:itcool.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template