Emacs 相当于 Vim 的命令历史记录(用于输入 Meta-x 命令)
问题:对于通过 Mx 调用的输入命令,我很难理解 Emacs 如何允许调用和重新运行命令。 命令历史的工作方式与 Vim 完全不同。 它将命令放入缓冲区而不是“迷你缓冲区”中。
有没有办法获得类似于 Vim 的方法(即,只需使用上下箭头键即可滚动以前键入的命令)?
Question: For typed in commands invoked via M-x I am having difficulty understanding how Emacs allows recalling and rerunning the commands. The command-history works quite differently from Vim. It puts the commands in a buffer rather than the "minibuffer".
Is there a way to get something similar to Vim's approach (i.e., previously typed commands can be scrolled through simply using the arrow up-down keys)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Cx ESC ESC
、Cx M-ESC
或Cx M-:
将您的历史记录放入迷你缓冲区中,之后您可以来回滚动使用箭头键即可。Mx list-command-history
将整个历史记录放入缓冲区中,您可以从中执行命令。Cx z
重复上一个命令。查看 EMACS 手册(信息)部分 8.5 迷你缓冲区历史记录。
C-x ESC ESC
,C-x M-ESC
, orC-x M-:
puts your history in the minibuffer, after which you can scroll back and forth as you like with the arrow keys.M-x list-command-history
puts the whole history in a buffer from which you can execute commands.C-x z
repeats the last command.Look at EMACS manual (info) section 8.5 Minibuffer History.
Mp 和 Mn 是 GNU 软件中规范的历史导航键。 Emacs 也不例外; 这几乎适用于任何可以输入内容的地方。
对于扩展命令(“Mx 命令”),请点击 Mx,然后在整个历史记录中自由导航。 您还可以使用 Cr 进行反向历史 isearch,就像在 bash 中一样。
M-p and M-n are the canonical history navigation keys in GNU software. Emacs is no exception; this works nearly everywhere where you can type something.
In the case of extended commands ("M-x commands"), hit M-x, then navigate freely throughout the history. You can also do a reverse history isearch with C-r, as in bash.
Call
It 将向您显示一个选项历史长度(此处默认为 30)。 如果您想保存跨 emacs 会话的历史记录,请参阅
您可以使用普通箭头键 向上
/
向下浏览历史。Call
It will show you an option History Length (it's 30 by default here). If you want to save your history across emacs sessions, see
You can use the normal arrow keys up
/
down to navigate through the history.