Open asmodeus812 opened 2 years ago
Bindings from multiple keys require the first key(s) to be prefix keys (e.g. C-x
is almost always a prefix key in emacs). y
d
and c
all seem a bit like prefix keys, but actually they are not. This is because evil needs finer control over a few things than emacs' basic prefix-key functionality. The downside is that you can't easily rebind keys like you are trying to for evil operator
s (that's what y
, d
, and c
actually are). Operators can be followed by text objects or motions, so you could try:
(define-key evil-motion-state-map "Y" 'evil-first-non-blank)
(or the evil-define-key equivalent) to achieve yY
becoming y^
but obviously this would mean Y
will always act like ^
when used as a motion. If this isn't an issue, then go for it (and the D
and C
versions) but if you want Y
to behave in this way only when used after y
then you'll have to write some elisp. I'm happy to give feedback if you give that a go.
Issue type
Environment
Emacs version: 27 (doom) Operating System: Ubuntu Evil version: latest Evil installation type: MELPA
Reproduction steps
I am trying to replicate a vimrc configuration by setting up the following key combos using already existing ones bu i am not successful. I receive the following error - Error in private config: config.el, (error Key sequence y Y starts with non-prefix key y)
I have tried multiple options as shown below
Expected behavior
Evil is capable of binding to key combos like vim.
Actual behavior
Observed error - Error in private config: config.el, (error Key sequence y Y starts with non-prefix key y)