Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我写了一个简单的函数,让 emacs 添加匹配的引号(所以当我输入 时",我得到"{cursor}")。但是现在,当我删除第一个引用但第二个引用仍然存在时,这是一个主要的烦恼。
"
"{cursor}"
有没有办法“监听”字符删除事件,并且下一个字符与删除的字符匹配,也删除下一个字符?
有现有的次要模式。请参阅EmacsWiki上的 AutoPairs。
autopair.el具有您所描述的特定功能。
(electric-pair-mode在 Emacs 24 中似乎没有)。
electric-pair-mode
相关问答(提到自动配对):