问题描述
该笔记将记录:在 GNU Emacs 中,与 Window 有关的设置。
解决方案
最大化当前 Window,并能切换(toggle)
在 Emacs 中,将 Frame 分割为多个 Window 之后,每个 Window 就会变小(毕竟 Frame 大小是有限的。
我们希望可以像 tmux 那样,将当前 pane 最大化(隐藏其他 panne),然后再切换回来。
在 GNU Emacs 中,有以下几种方式实现:
1)delete-other-windows + winner-mode,解释:delete-other-windows 负责关闭除当前的其他 Window,而 winner-mode 用于恢复之前的 Window 布局。
2)使用 zoom-window 插件(我们采用的方式)
如下笔记将记录,如何使用 zoom-window 来切换 Window 最大化:
1)M-x package-install [RET] zoom-window [RET]
2)在 ~/.emacs 中,添加绑定 zoom-window-zoom 的快捷键:
(global-set-key (kbd "s-z") 'zoom-window-zoom) ;; Super + z / Window + z
参考文献
Learning emacs part 4: buffers, windows, and frames – Blasphemous Bits
EmacsWiki/WinnerMode
20.7 Convenience Features for Window Handling
In Emacs, can we maximize current active window, and then restore it back in multiple window environment? – Stack Overflow
emacsorphanage/zoom-window: Zoom and Unzoom window