Emacs窗口定位

时间:2011-08-08 04:57:31

标签: emacs

也许这是一个愚蠢的问题..但我正在努力让我的emacs定制细粒度..是否有直接命令改变这样的窗口?

+----------------+
|                |    
|                |
+----------------+
|                |
|                |
+----------------+

+----------------+------------+
|                |            |
|                |            |
+----------------+            |
|                |            |
|                |            |
+----------------+------------+

或者我是否需要开始学习elisp?

1 个答案:

答案 0 :(得分:5)

是的,你会,但玩弄窗口布局和缓冲区是一个非常好的起点。这里有一个解决方案,它为您提供了自定义布局所需的大部分内容。

将以下代码添加到.emacs中。 C-x C-e来评估它,然后希望击中F5将按预期执行(假设你没有杀死'* Messages *'缓冲区)。

global-set-key '[f5] '(lambda () (interactive)             
                        (let ((other (buffer-name (window-buffer (next-window)))))
                        (delete-other-windows)
                    (set-frame-width (selected-frame)
                    (+ (frame-width (selected-frame)) (window-width)))
                    (split-window-horizontally)
                    (split-window-vertically)
                    (with-selected-window (next-window)
                       (set-window-buffer (selected-window) other))
                    (with-selected-window (previous-window) 
                       (set-window-buffer (selected-window) "*Messages*")))))