syl20bnr / evil-escape

Customizable key sequence to escape from insert state and everything else in Emacs.
GNU General Public License v3.0
225 stars 42 forks source link

Visual mode exits when selecting lines down with evil-escape-key-sequence 'jk' #79

Open stevensona opened 7 years ago

stevensona commented 7 years ago

With evil-escape-key-sequence set to "jk", in visual mode, I can't hold 'j' to select multiple lines because it exits visual mode. Highlighting lines up works as expected.

On spacemacs develop branch.

stevensona commented 7 years ago

https://github.com/syl20bnr/evil-escape/pull/61

add

(push 'visual evil-escape-excluded-states)

to exclude visual from evil-escape

thanks to @weaksauce on spacemacs gitter.

fiveNinePlusR commented 7 years ago

if you are only pressing j and not k this bug is probably still valid. I just put that in my config because i only really want jk or kj to get me out of insert mode and not from all the other ancillary modes.

illia-danko commented 4 years ago

61

add

(push 'visual evil-escape-excluded-states)

to exclude visual from evil-escape

thanks to @weaksauce on spacemacs gitter.

I've experienced an opposite issue using doom-emacs: after remapping evil-escape-key-sequence to 'fd' (useful to left-handed people) there isn't a straight way to force exiting the visual mode with the escape sequence. Have found that 'visual is in the evil-escape-excluded-states by default. So adding the following snippet resolves my issue:

(after! evil-escape
  (setq evil-escape-key-sequence "fd")
  ;; Allow to escape from the visual state as from insert.
  (delete 'visual evil-escape-excluded-states))
;;