Emacs字体大小与Ctrl键和鼠标滚动 [英] Emacs font sizing with Ctrl key and mouse scroll

查看:229
本文介绍了Emacs字体大小与Ctrl键和鼠标滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

notepad ++允许我增加字体大小,当我按住 Ctrl 键并旋转鼠标中间滚动按钮转发。

notepad++ allow me to increase the font size when I hold the Ctrl Key and rotate the mouse middle scroll button to forward.

同样的方式,当我持有 Ctrl 并向后旋转鼠标中间滚动按钮时,喜欢的大小减小。

In the same way, the when I hold Ctrl and rotate the mouse middle scroll button backward, the fond size reduces.

如何获得与Emacs相同?

How can I get the same with Emacs?

推荐答案

代码

code for AlexCombas' answer:


(defun font-big ()
 (interactive)
 (set-face-attribute 'default nil :height 
  (+ (face-attribute 'default :height) 10)))

(defun font-small ()
 (interactive)
 (set-face-attribute 'default nil :height 
  (- (face-attribute 'default :height) 10)))

(global-set-key (kbd "<C-wheel-down>") 'font-small)
(global-set-key (kbd "<C-wheel-up>") 'font-big)

编辑:最小和最大使用


(defun font-big ()
 (interactive)
 (set-face-attribute 'default nil :height 
  (min 720
   (+ (face-attribute 'default :height) 10))))

(defun font-small ()
 (interactive)
 (set-face-attribute 'default nil :height 
  (max 80
   (- (face-attribute 'default :height) 10))))

这篇关于Emacs字体大小与Ctrl键和鼠标滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆