你们的 Emacs 一般分几屏?分屏多了,切换窗口,有没有小技巧?

2014-08-13 11:44:32 +08:00
 zhonghua
我现在是分4屏,原来还使用speedbar,现在直接使用c-x d

但是发现切换窗口时,得按好几次的c-x o,有时加上alt+2/3 c-x o。

但是还得记得,窗口的打开顺序及切换顺序。

不知道你们是怎么处理这个问题的?
10335 次点击
所在节点    程序员
9 条回复
elvodn
2014-08-13 11:52:39 +08:00
ace-jump-window
df
2014-08-13 12:36:37 +08:00
尽量只用 1 个,当超过 3 屏的情况,就要关掉不必要的。

用鼠标方便就用。

要用简单的方式操作 Emacs。
senghoo
2014-08-13 12:51:30 +08:00
一般两个。这样c-x o 的行为就确定了。
zhonghua
2014-08-13 12:59:58 +08:00
@elvodn
@df
@senghoo thankyouall
gno23x
2014-08-13 13:08:35 +08:00
可以尝试下 https://github.com/dimitri/switch-window,我个人就经常会有4个窗口的情况出现,甚至有时候还觉得不够用。

相对ace-jump-window,switch-window给出的标示明显很多。

你可以看下preview http://tapoueh.org/emacs/switch-window.html,其中数字可以配置成英文abcd或者qwer又或者是asdf。

实际上,现在我很少用switch-window,更喜欢使用 https://github.com/troydm/emacs-stuff/blob/master/windcycle.el

将SHIFT+上下左右分别绑定到windmove-up-cycle等几个命令,然后只需要SHIFT+方向键即可在窗口间移动。
odirus
2014-08-13 13:39:59 +08:00
集中注意力在一个窗口
siteshen
2014-08-13 13:48:20 +08:00
;; 分2-4屏(没用过更大的显示器了),绑定M-0到'other-window
(defun smart-split ()
(interactive)
(delete-other-windows)
(split-window-horizontally) ;; 最少分两屏
(other-window 1)
(switch-to-next-buffer)
(other-window 1)
(unless (< (window-width) 120) ;; 240+ 三屏
(split-window-horizontally)
(balance-windows)
(switch-to-next-buffer)
(other-window 1))
(unless (< (window-width) 100) ;; 300+ 四屏
(split-window-horizontally)
(balance-windows)
(switch-to-next-buffer)
(other-window 1))
(recenter))

(progn
(keydef "M-0" other-window)
(keydef "M-4" kill-this-buffer)
(keydef "M-1" delete-other-windows)
(keydef "M-2" smart-split)
(keydef "M-3" split-window-horizontally))
vzex
2014-08-13 14:06:12 +08:00
ecb + ido-mode
xlmo
2014-08-13 14:52:39 +08:00
;;window jump
(global-set-key (kbd "s-k") 'windmove-up)
(global-set-key (kbd "s-j") 'windmove-down)
(global-set-key (kbd "s-h") 'windmove-left)
(global-set-key (kbd "s-l") 'windmove-right)

http://www.emacswiki.org/emacs/WindMove

我绑定到hjkl上,直接跳转窗口,很方便。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/127595

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX