有没有办法在Emacs中使用retile缓冲窗口?

Dav*_*own 8 emacs

我在emacs中打开了两个缓冲窗口,垂直排列.是否有一个水平重新排列它们的命令?

phi*_*ils 7

所述移调帧库提供了一个极好的功能集针对帧中的操纵的窗口(任一transpose-frame,rotate-frame-clockwiserotate-frame-anti-clockwise将足以为特定的例子).

还有其他选择,但我发现这个库相当全面.有关每个函数的功能,请参阅Wiki页面(或代码中的注释).


Xae*_*ess 4

我使用以下摘自 Emacs wiki 的片段

(defun toggle-window-split ()
  (interactive)
  (if (= (count-windows) 2)
      (let* ((this-win-buffer (window-buffer))
         (next-win-buffer (window-buffer (next-window)))
         (this-win-edges (window-edges (selected-window)))
         (next-win-edges (window-edges (next-window)))
         (this-win-2nd (not (and (<= (car this-win-edges)
                     (car next-win-edges))
                     (<= (cadr this-win-edges)
                     (cadr next-win-edges)))))
         (splitter
          (if (= (car this-win-edges)
             (car (window-edges (next-window))))
          'split-window-horizontally
        'split-window-vertically)))
    (delete-other-windows)
    (let ((first-win (selected-window)))
      (funcall splitter)
      (if this-win-2nd (other-window 1))
      (set-window-buffer (selected-window) this-win-buffer)
      (set-window-buffer (next-window) next-win-buffer)
      (select-window first-win)
      (if this-win-2nd (other-window 1))))))

(define-key ctl-x-4-map "t" 'toggle-window-split)
Run Code Online (Sandbox Code Playgroud)

只需将其放入init.el并使用Ctrl- x 4 t