Timeline for How to quit key sequence using evil / spacemacs?
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 26, 2017 at 18:54 | comment | added | mclear | great - I updated my original answer. | |
Jan 26, 2017 at 18:54 | history | edited | mclear | CC BY-SA 3.0 |
refined answer
|
Jan 26, 2017 at 18:51 | vote | accept | Shadowigor | ||
Jan 26, 2017 at 18:50 | comment | added | Shadowigor | Yes, thank you, that's what I searched for! Works like a charm! | |
Jan 25, 2017 at 15:59 | comment | added | mclear |
Actually, now that I understand what you want (I was being a bit dense before!) I think you could probably get what you want using (define-key evil-motion-state-map (kbd "<right>") 'evil-normal-state) . This works for me in the case of motions like using d in normal to delete something and then <right> to cancel and go back to the normal state.
|
|
Jan 25, 2017 at 7:50 | comment | added | Shadowigor |
Sorry for the confusion. My intention is, that <right> behaves like pressing ESC (or C-g ). I had no problem getting most of this to work, but I can't get <right> to abort a key sequence (as stated in the title). So you think there is no way of making <right> behave like ESC or C-g ?
|
|
Jan 24, 2017 at 4:49 | comment | added | mclear |
So I'm no longer sure that I fully understand what you want (if so, sorry for that!). I thought what you wanted was a reliable way to use <right> to go to normal mode. But if it is just to cancel a key sequence why not use C-g ? That seems to work as a universal cancellation sequence. Given that d in normal mode expects a further modifier, of which <right> is one, I don't think you can get what you want without doing some significant key remapping.
|
|
Jan 23, 2017 at 19:08 | comment | added | Shadowigor | I just tried it with a clean .spacemacs file and added just the line you mentioned. If I press 'd' and then '<right>', the character under the cursor still gets deleted, so it doesn't work for me. | |
Jan 22, 2017 at 0:47 | comment | added | mclear |
So (define-key evil-insert-state-map (kbd "<right>") 'evil-normal-state) works for me. You might have to disable evil-escape first though. If it doesn't work for you then there is likely something else in your config that is inhibiting it.
|
|
Jan 21, 2017 at 23:22 | comment | added | Shadowigor | Unfortunately, neither worked. | |
Jan 21, 2017 at 0:59 | comment | added | mclear |
you might also bypass evil-escape entirely and bind it this way: (define-key evil-insert-state-map (kbd "<right>") 'evil-normal-state)
|
|
Jan 20, 2017 at 22:11 | comment | added | mclear | Try binding it directly as stated here: github.com/syl20bnr/evil-escape/blob/master/… | |
Jan 20, 2017 at 8:50 | comment | added | Shadowigor | I just did, it didn't work. But if I understand it correctly, it expects a key sequence, not a single key. How would I do that? I already tried ["<right>"] and (kbd "<right>") without success. | |
Jan 16, 2017 at 1:56 | history | answered | mclear | CC BY-SA 3.0 |