Making ^J and ^H work in / (search)

Dmitry Alexandrov 321942 at
Tue Jun 28 16:01:04 CEST 2016

Alexander Berntsen <alexander at> writes:

> I have the following:
> (global-set-key (kbd "C-h") 'delete-backward-char)
> (global-set-key (kbd "C-j") (kbd "RET"))
> How do I make this work in evil-mode's / (search)?
> Bonus points if anyone has the scoop on making it work in helm as well.

I guess, you actually want to make ‘C-h’ equal to ‘DEL’ and ‘C-j’ to
‘RET’ *everywhere*, not just in isearch (there is no any evil-mode’s
search, as far I know), helm, etc.  Nothing is easier:

  (define-key key-translation-map (kbd "C-h") (kbd "DEL"))
  (define-key key-translation-map (kbd "C-j") (kbd "RET"))

I would not reject ‘C-j’ though, it is useful sometimes to have two
returns: a ‘smart’ one and a ‘dumb’ one.

More information about the implementations-list mailing list