dagda1
dagda1

Reputation: 28780

emacs - error: Key sequence

I am getting errors when I try to add this to my ~/.emacs file:

(define-key evil-normal-state-map "ss" 'split-window-vertically)

I get this error:

error: Key sequence s s starts with non-prefix key s

Upvotes: 3

Views: 856

Answers (1)

Dan
Dan

Reputation: 5369

The problem is that there is already a command bound to s (specifically, evil-substitute), which means you could not get to you ss binding because the first s would invoke evil-substitute. You can undefine the s by setting it to nil and then bind ss as you already have it:

(define-key evil-normal-state-map "s" nil)
(define-key evil-normal-state-map "ss" 'split-window-vertically)

(If you want to know what commands are bound to which keys, you can use M-x describe-key SOMEKEY or C-h k SOMEKEY.)

Upvotes: 4

Related Questions