V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
zhonghua
V2EX  ›  程序员

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

  •  
  •   zhonghua · 2014-08-13 11:44:32 +08:00 · 10326 次点击
    这是一个创建于 3545 天前的主题,其中的信息可能已经有所发展或是发生改变。
    我现在是分4屏,原来还使用speedbar,现在直接使用c-x d

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

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

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

    用鼠标方便就用。

    要用简单的方式操作 Emacs。
    senghoo
        3
    senghoo  
       2014-08-13 12:51:30 +08:00 via iPad
    一般两个。这样c-x o 的行为就确定了。
    zhonghua
        4
    zhonghua  
    OP
       2014-08-13 12:59:58 +08:00
    @elvodn
    @df
    @senghoo thankyouall
    gno23x
        5
    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
        6
    odirus  
       2014-08-13 13:39:59 +08:00
    集中注意力在一个窗口
    siteshen
        7
    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
        8
    vzex  
       2014-08-13 14:06:12 +08:00
    ecb + ido-mode
    xlmo
        9
    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上,直接跳转窗口,很方便。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2806 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 06:33 · PVG 14:33 · LAX 23:33 · JFK 02:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.