1. Frank Fischer
  2. evil
  3. Issues
Issue #160 resolved

"cw" followed by "c-["

created an issue

I pretty much exclusively use "c-[" for escaping from insert mode. For some reason, after using "cw", or other "c" commands, I am unable to escape using "Ctrl-[" for about 2-5 seconds. Using the escape key itself seems to work, but not Ctrl-[. Any idea as to how this could be fixed? I don't use ESC for meta commands at all, so if it overrides that functionality completely it'd be fine.

As for the build, it's Cocoa Emacs 24 on OSX 10.7, so it's not a terminal issue.

Comments (5)

  1. Frank Fischer repo owner
    • changed status to open

    Unfortunately I do not have access to OSX and I can't reproduce the problem here (it always works). But you could try to bind everything to (kbd "ESC") that is bound to [escape] is bound to. Have a look in evil-maps.el, where all key-bindings are defined and look for bindings of [escape]. Then simply define the analogous bindings for (kbd "ESC"):

    (define-key evil-insert-state-map [escape] 'evil-normal-state)
    ;; gets
    (define-key evil-insert-state-map (kbd "ESC") 'evil-normal-state)

    You should do this for every binding of [escape].

    Anyhow, it would be nice to understand what causes the trouble. The change commands simply delete the text and then switch to insert state. So it is really surprising that the problem occurs only with change commands.

  2. tmvphil reporter

    I think the change command may have been a red herring. It appears the real culprit is auto-complete-mode. It seems that it happens whenever auto-complete catches onto something, at which point "c-[" gets translated into meta. I don't have time to test out your rebindings at the moment, but disabling auto-complete seems to fix it for now. Perhaps there is another auto-complete package which is more compatible?

  3. Frank Fischer repo owner

    I'm using auto-complete on my own. The problem with those packages is the repeat system which always requires some configuration for each package. Currently only auto-complete is configured that way (in evil-integration.el). Anyway, you may find other packages in EmacsWiki like company or camode.

  4. Log in to comment