Emacs Tips
2023-08-31
257 words
1 min read
Emacs Tips
Bind “muhenkan” key to evil-escape
in Spacemacs
In vim and hybrid editing styles in Spaecemacs, you hit “ESC” key frequently to escape to “normal mode”. But “ESC” keye is far away from the home row.
In a Japanse 106 keyboard, there some unused keys:
So bind “muhenkan” key (lett to the spacebar) to =evil-escape" to espcape to normal mode.
Add this to your Emacs configuration:
(define-key global-map (kbd "<muhenkan>") 'evil-escape)
If you do not use a Japanese keybord, please replace “<muhenkan>” with the key you want to use.
That’s all. Enjoy!
TODO Bind “Henkan” key to set shift key in Emacs
This means that if you hit “Henkan” key, then hit “s”, then you get “T”.
For example:
Henkan t
→ T
This is for Japanese 106 only.
To bind “Henkan” to enter “Shit”,
Write this in you Emacs configuration.
Replace 'henkan
to the key you want to use:
(let ((i ?a))
(while (<= i ?z)
(define-key key-translation-map
(vector 'henkan i) (vector (- i 32)))
(setq i (1+ i))))
(setq x-meta-keysym 'meta)
(setq x-super-keysym 'meta)
That’s all.
Enjoy!
(let ((i ?a))
(while (<= i ?z)
(define-key key-translation-map
(vector 'muhenkan i) (vector (- i 32)))
(setq i (1+ i))))
(setq x-meta-keysym 'meta)
(setq x-super-keysym 'meta)