Chinaunix首页 | 论坛 | 博客
  • 博客访问: 120791
  • 博文数量: 24
  • 博客积分: 3030
  • 博客等级: 中校
  • 技术积分: 580
  • 用 户 组: 普通用户
  • 注册时间: 2007-01-11 10:58
文章分类

全部博文(24)

文章存档

2011年(2)

2010年(4)

2009年(10)

2008年(8)

我的朋友

分类: LINUX

2010-04-21 13:16:52

Someone give me this function. 改变两个窗口的水平垂直平铺格局

(defun swap-window-split () "If the current frame has just two windows, then replace a vertical split with a horizontal split, or vice-versa. Otherwise do nothing." (interactive) (let ((root-window (car (window-tree)))) (if (windowp root-window) (message "There's just one big window") (let ((w1 (elt root-window 2)) (w2 (elt root-window 3))) (if (or (not (windowp w1)) (not (windowp w2))) (message "Not a simple split") (let ((b1 (window-buffer w1)) (b2 (window-buffer w2))) (delete-other-windows w1) (if (car root-window) (split-window-horizontally) (split-window-vertically)) (other-window 1) (set-window-buffer (selected-window) b2))))))) (global-set-key (kbd "") 'swap-window-split)


阅读(545) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

dealover2010-04-21 14:57:36

This snippet can switch window layout between vertically and horizontally. (defun qw-swap-two-window-split () "Swap two windows in one frame, from vertical to horizontal or vice versa" (interactive) (if (= (count-windows) 2) (let ((root-window (car (window-tree)))) (let ((w1 (elt root-window 2)) (w2 (elt root-window 3))) (let* ((first-buf (window-buffer w1)) (second-buf (window-buffer w2))) (delete-other-windows w1) (if (car root-window) (split