博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Change font size quickly
阅读量:6364 次
发布时间:2019-06-23

本文共 1492 字,大约阅读时间需要 4 分钟。

Change font size quickly

1,612 pages on
this wiki

 

Duplicate tip

This tip is very similar to the following:

These tips need to be merged – see the .

created 2004 · complexity intermediate · author Wouter Bolsterlee · version 6.0


If you regularly switch to a larger or smaller font, for example because someone looking at your code thinks the letters are too small, or because you want to lay back in your chair while reading, this tip is for you.

The following script defines two commands, :LargerFont and :SmallerFont, to allow quick adjustments to the font size used in the gtk2 gui. Change minfontsize and maxfontsize to suit your needs. See below for alternative solutions.

To use this script, put the following code into ~/.vim/plugin/gtk2fontsize.vim or in your vimrc.

let s:pattern = '^\(.* \)\([1-9][0-9]*\)

let s:minfontsize = 6 let s:maxfontsize = 16 function! AdjustFontSize(amount) if has("gui_gtk2") && has("gui_running") let fontname = substitute(&guifont, s:pattern, '\1', '') let cursize = substitute(&guifont, s:pattern, '\2', '') let newsize = cursize + a:amount if (newsize >= s:minfontsize) && (newsize <= s:maxfontsize) let newfont = fontname . newsize let &guifont = newfont endif else echoerr "You need to run the GTK2 version of Vim to use this function." endif endfunction function! LargerFont() call AdjustFontSize(1) endfunction command! LargerFont call LargerFont() function! SmallerFont() call AdjustFontSize(-1) endfunction command! SmallerFont call SmallerFont()

转载地址:http://gjama.baihongyu.com/

你可能感兴趣的文章
猫头鹰的深夜翻译:spring事务管理
查看>>
记一次使用Spring REST Docs + travis + github自动生成API接口文档的操作步骤(下)...
查看>>
1、集合 2、Iterator迭代器 3、增强for循环 4、泛型
查看>>
关于/var/run/docker.sock
查看>>
SCrapy爬虫大战京东商城
查看>>
用 JavaScript 实现链表操作 - 11 Alternating Split
查看>>
Laravel优秀扩展包整理
查看>>
日志分析之识别真假蜘蛛与处理办法
查看>>
回顾小程序2018年三足鼎立历程,2019年BAT火力全开
查看>>
太多脚本将会毁掉持续交付
查看>>
一地鸡毛 OR 绝地反击,2019年区块链发展指南
查看>>
C# 8新提案让泛型Attribute成为现实
查看>>
ASP.NET Core:简洁的力量
查看>>
关于AWS的Firecracker,技术人应该知道的十件事
查看>>
卢森堡大学发布RepuCoin系统,可破解区块链51%攻击
查看>>
国内云计算厂商众生相:四大阵营十几家企业生存盘点
查看>>
细说Unicode(一) Unicode初认识
查看>>
Node.js有了新的管理者
查看>>
虚拟研讨会:.NET的未来在哪里?
查看>>
Java 20年:历史与未来
查看>>