6

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

(windmove-default-keybindings 's)

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

如何仅绑定命令键?

4

1 回答 1

4

The bindings are set by windmoves windmove-default-keybindings function, you can undo what this function does with the following:

(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)))

Also, you'll need to ensure the variable shift-selection-mode is non-nil.

(setq shift-selection-mode t)

Prelude disables arrow movement by default, and for good reason. You are doing a great disservice to yourself by using arrow keys to select text. But if you really want to, this will allow you to.

(setq prelude-guru nil)

This should get shift-selection back up and running, but you'll need to find new keys to use for windmove.

于 2014-07-13T14:14:03.443 回答