对另一个窗口进行上下翻页

2022-12-14 18:16:32 浏览数 (1)

在使用 Emacs 时,经常会进行分屏,比如左边写代码,右边看文档。

当左窗口为 active 时,可以利用下面两个快捷键对右边的窗口进行翻页

  • C-M-v 向下翻页
  • C-M-V 向上翻页

这个默认快捷键不是很好按,我个人一般采用下面的按键方式:

代码语言:javascript复制
(global-set-key (kbd "C-0") 'scroll-other-window)  ;; 向下翻
(global-set-key (kbd "C-9") 'scroll-other-window-down) ;; 向上翻

本来更好的键位是 C-[C-] ,但是在很多系统中,Control 键经常用作转义,比如 C-[ 在 US 键盘中表示 escape ,所以最好不要用 Control 来组合一些特殊符号来用。

参考

  • • Scroll other window | Pragmatic Emacs[1]
  • • [key bindings - How to bind C- for real? - Emacs Stack Exchange[2]
  • • Who stole “C-.”, “C-;” and possibly other keys from my Emacs?[3]
引用链接

[1] Scroll other window | Pragmatic Emacs: https://pragmaticemacs.wordpress.com/2016/11/28/scroll-other-window/ [2] for real? - Emacs Stack Exchange: https://emacs.stackexchange.com/questions/7832/how-to-bind-c-for-real [3] Who stole “C-.”, “C-;” and possibly other keys from my Emacs?: https://emacsnotes.wordpress.com/2022/08/16/who-stole-c-c-and-possibly-other-keys-from-my-emacs/

0 人点赞