如何使 M-( 键入开始的“(”字符的默认行为?我希望 Emacs 在我键入“(”字符时自动在光标后插入结束的“)”,而不管它是否是 M-的一部分组合键。另外,我想将此行为扩展到引号、子引号、方括号和大括号。键入 M-( 是一种痛苦,并且对于其他字符似乎没有任何可比较的形式。
最佳答案
我自己写的 elisp 并不多,但这是我抄袭某人的东西。代码进入您的 .emacs。
(setq skeleton-pair t)
(setq skeleton-pair-on-word t) ; apply skeleton trick even in front of a word.
(global-set-key "[" 'skeleton-pair-insert-maybe)
(global-set-key "{" 'skeleton-pair-insert-maybe)
(global-set-key "(" 'skeleton-pair-insert-maybe)
(global-set-key "\"" 'skeleton-pair-insert-maybe)
关于emacs - 制作 M-( 当输入 "("时 Emacs 中的默认行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/718428/