How can i remap a non-ascii keyboard character in evil-mode?

161 Views Asked by At

I would like to remap the key "é" on my keyboard to ctrl-w in emacs evil-mode (doom emacs)

I tried with

(define-key evil-operator-state-map "é" "\C-w") 
;; and
(global-set-key "é" "\C-w")

But none of these worked.

Is what I'm trying to do possible ?

How can I do it ?

1

There are 1 best solutions below

0
Drew On

Try this:

(define-key key-translation-map (kbd "é") (kbd "C-w"))
  1. Use (kbd KEY-SEQUENCE), where KEY-SEQUENCE is what Emacs tells you the key sequence is.

  2. Use key-translation-map to translate keys. See the Elisp manual, node Translation Keymaps.