2

In Isearch, after hitting C-s a few times, you have to hit DEL a few times to get back to editing the search string.

How can I disable this behavior? I'd like it so that DEL always deletes a character from the search string (the behavior of DEL when you've hit C-s just once [to activate Isearch initially]).

3

The key C-M-w does what you are asking for. It is bound in isearch-mode-map to isearch-del-char, while DEL is bound to isearch-delete-char.

If you really want DEL to be bound to isearch-del-char then just bind it:

(define-key isearch-mode-map (kbd "DEL") 'isearch-del-char)

Similarly, you could bind C-M-w to isearch-delete-char, if you wanted to:

(define-key isearch-mode-map (kbd "C-M-w") 'isearch-delete-char)

You can find out which keys are bound to which commands in isearch-mode-map or any other keymap using C-h M-k (describe-keymap), if you use library help-fns+.el.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.