t**********g 发帖数: 3388 | 1 【 以下文字转载自 Linux 讨论区 】
发信人: thanksgiving (~灯红酒绿的上海~), 信区: Linux
标 题: emacs里面有没有快捷建能交换2个窗口的内容?
发信站: BBS 未名空间站 (Thu Nov 1 19:36:06 2007)
emacs里面用ctrl+x 3打开两个窗口,不同的文件内容。有没有快捷建能swap左右2各窗
口? | c****e 发帖数: 1453 | 2 不知道, 可以 ctrl+x o 到下面的窗口, ctrl+x 0, ctrl+x 3 | r*********s 发帖数: 2157 | 3 我用下面的, 然后 C-c o 交换两个windows
;; transpose(interchange) two windows
(defun his-transpose-windows (arg)
"Transpose the buffers shown in two windows."
(interactive "p")
(let ((selector (if (>= arg 0) 'next-window 'previous-window)))
(while (/= arg 0)
(let ((this-win (window-buffer))
(next-win (window-buffer (funcall selector))))
(set-window-buffer (selected-window) next-win)
(set-window-buffer (funcall selector) this-win)
(select-window (funcall selector)))
(setq arg (if (plusp arg) (1- arg) (1+ arg |
|