繁体   English   中英

emacs shell模式下的命令历史

[英]Command history in emacs shell mode

在 bash shell 中,我可以使用向上箭头键导航到之前输入的命令。 但这在 emacs shell 模式下不起作用。 有什么方法可以启用此功能吗?

Mp (和另一个方向的Mn )可以解决问题。

这是有关该主题的 Emacs 手册的链接

将此添加到您的~/.emacs

(define-key comint-mode-map (kbd "<up>") 'comint-previous-input)
(define-key comint-mode-map (kbd "<down>") 'comint-next-input)

CpCnCr也适用于(原版)bash,以及其他一些 emacs 键。 非常便利。

在 Gnu Emacs 中,Shell 模式的菜单称为“In/Out”。 (我认为它还涵盖了称为“comint”的更通用的模式。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM