如何映射“jj”在emacs中Esc Esc的模式 [英] How to map "jj" to Esc in emacs Evil mode
本文介绍了如何映射“jj”在emacs中Esc Esc的模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我映射它像这样但似乎不正确:
(define-key evil-insert-state-map(kbdjj)'邪恶正常状态)
解决方案
这对我有用。它需要 KeyChord 库:
(setq key-chord-two-keys-delay 0.5)(key-chord-define evil- insert-state-mapjj'evil-normal-state)
(key-chord-mode 1)
它的灵感来自上面的@phils答案,并基于 Simon's Coding博客:Emacs和Unity每天。
Recently I tried Emacs and found Evil helpful to keep my vim custom. I'm used to typing "jj" to return normal mode from insert mode like many Vimers do but don't know how to make it in Evil mode.
I map it like this but seems not correct:
(define-key evil-insert-state-map (kbd "jj") 'evil-normal-state)
解决方案
This works for me. It requires the KeyChord library:
;;Exit insert mode by pressing j and then j quickly
(setq key-chord-two-keys-delay 0.5)
(key-chord-define evil-insert-state-map "jj" 'evil-normal-state)
(key-chord-mode 1)
It is inspired by @phils answer above and based on Simon's Coding Blog: Emacs and Unity Every Day.
这篇关于如何映射“jj”在emacs中Esc Esc的模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文