【问题标题】:Setting SHIFT+arrow keys to select text in emacs prelude设置 SHIFT+箭头键选择 emacs prelude 中的文本
【发布时间】:2014-07-13 07:49:37
【问题描述】:

在 emacs prelude 中,我希望 SHIFT+箭头选择文本。默认情况下,SHIFT+箭头被分配给windmove。我在个人/预加载文件夹中创建了一个 windmove.el 文件,其中包含以下内容

(windmove-default-keybindings 's)

但是有了这个,shift 和 command 键都绑定到 windmove。

如何只绑定命令键?

【问题讨论】:

    标签: emacs emacs-prelude


    【解决方案1】:

    绑定是由windmoves windmove-default-keybindings函数设置的,你可以用以下方法撤销这个函数的作用:

    (global-unset-key (vector (list 'shift 'left)))
    (global-unset-key (vector (list 'shift 'right)))
    (global-unset-key (vector (list 'shift 'up)))
    (global-unset-key (vector (list 'shift 'down)))
    

    此外,您需要确保变量 shift-selection-mode 不为零。

    (setq shift-selection-mode t)
    

    Prelude disables arrow movement by default,这是有充分理由的。使用箭头键选择文本对自己造成了极大的伤害。但是,如果您真的想这样做,这将允许您这样做。

    (setq prelude-guru nil)
    

    这应该可以让 shift-selection 恢复并运行,但您需要找到用于 windmove 的新键。

    【讨论】:

    • Mmmmm...我会看看教程然后;)。非常感谢您的回答和建议
    • @Jordon:如何将windomove重置为其他键而不是禁用它?我知道一般的方法,但是就前奏设置而言有什么不同吗?
    • @Kayuntey:本网站对此进行了描述:emacswiki.org/emacs/WindMove,请参阅“终端”
    • “您使用箭头键选择文本对自己造成了极大的伤害”这里的真正用例是 <a convenient modifier key> + <any navigation keys> 进行任何导航移动 + 更新选择。 <Shift> + <arrows> 只是 Shift 作为 mod 的(最佳)特例中最不重要的子集。钥匙。然后,另一个关键概念是一致性,以减轻认知负担。摒弃这种非常有效的使用模式(在整个非 emacs 世界中作为一种普遍存在的基本反射铭刻在 Prelude 的一半目标受众中!:))听起来非常教条。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-08
    • 2014-11-06
    • 2013-12-20
    • 2012-04-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多