Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to make ESC key send isearch-abort instead of isearch-cancel while searching? #279

Closed
JohnWick95 opened this issue Nov 24, 2021 · 2 comments
Labels

Comments

@JohnWick95
Copy link

Hello,

A problem while searching in EVIL using / (with isearch) and pressing ESC is that the point doesn't go back to where the search started but pressing Ctrl-g instead of ESC does send you back. It looks like ESC is mapped to isearch-cancel and Ctrl-g is mapped to isearch-abort.

I have tried with many variations from your guide explanations to map ESC to isearch-abort instead of isearch-cancel with no success.

How can I make ESC send isearch-abort during a search? I know about the evil-search module which does the 'correct' thing but lacks the features of isearch which I prefer.

@noctuid
Copy link
Owner

noctuid commented Nov 26, 2021

I don't use isearch, but you should just be able to bind it in isearch-mode-map:

(define-key isearch-mode-map (kbd "<escape>") #'isearch-abort)

@JohnWick95
Copy link
Author

Great, I was playing with variations of something like:

(evil-define-key 'normal isearch-mode-map (kbd "<escape>") #'isearch-abort)

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants