6

In emacs prelude I want SHIFT+arrow to select text. By default SHIFT+arrow is assigned to windmove. I've created a windmove.el file in my personal/preload folder with the following contents

(windmove-default-keybindings 's)

But with this both shift and command key are bound to windmove.

How can I bind only command key?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Rafa de Castro
  • 2,474
  • 1
  • 24
  • 44

1 Answers1

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.

TomRoche
  • 1,464
  • 1
  • 16
  • 25
Jordon Biondo
  • 3,974
  • 1
  • 27
  • 37