Skip to main content
edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
edited tags
Link
Drew
  • 79.1k
  • 10
  • 123
  • 257
Source Link
Rogach
  • 277
  • 1
  • 5

How to bind C-h to delete-backward-char when doing isearch?

I use C-h as an alias for delete-backward-char everywhere.

But when I do isearch it exits the search instead of deleting the character before the cursor.

I tried binding C-h in isearch maps, but that didn't work:

(define-key minibuffer-local-isearch-map (kbd "C-h") 'delete-backward-char)
(define-key isearch-mode-map (kbd "C-h") 'delete-backward-char)

Character gets deleted, but it is deleted in the buffer, not in the isearch prompt.

Is there a way to rebind C-h so it works in isearch prompt?