emacs - CTL-] 的正确名称是什么?
问题描述
从我的 .emacs 中:
(defun flip-window () "Flip this window" (interactive)
(switch-to-buffer (other-buffer)))
;; later
(global-set-key [(control ?])] 'flip-window)
效果很好,但我有两个问题:
- 是否有内置函数可以翻转到最近访问的缓冲区?
- 虽然上述方法在 emacs 启动时有效,但在我尝试更新设置时会导致问题,存在由 ?] 引起的解析错误。那么有没有更好的方法来表达 control-] 击键?
解决方案
对问题2的回答。您可以在设置键绑定时尝试kbd功能。
像这样:
(global-set-key (kbd "C-]") 'flip-window)
对于问题 1:我想没有内置功能。Emacs redux 教我们像这样实现它:
(defun er-switch-to-previous-buffer ()
"Switch to previously open buffer. Repeated invocations toggle between the two most recently open buffers."
(interactive)
(switch-to-buffer (other-buffer (current-buffer) 1)))
这是 Emacs Prelude 发行版的一部分。见https://emacsredux.com/blog/2013/04/28/switch-to-previous-buffer/
推荐阅读
- powershell - 对远程 WebDriver 服务器的 HTTP 请求在 60 秒后超时。仅在通过任务调度程序运行时发生
- azure - 你知道故障域和更新域的一个很好的解释吗?
- java - CompletableFuture 的问题 - 不等待调用所有 URL
- javascript - 无法从动态数据列表中获取选定元素的值(仅获取最后一个元素)
- c# - 是否可以使用“Array.IndexOf”或其他代码派生数据对数据库中的 EF 查询结果进行排序?
- javascript - 使用纯 JavaScript 的智能手机 USB-OTG 串行连接
- sql - PSQLException:错误:大型查询超出堆栈深度限制
- java - 如何在java代码中调用jboss默认工作管理器?
- javascript - 将对象中的数组值链接到嵌套对象中的数组
- java - 获取字符的“前两次”出现之间的子字符串