Emacs shell 模式下的 Bash 自动补全 [英] Bash autocompletion in Emacs shell-mode
问题描述
在 GNOME 终端中,Bash 执行智能自动完成.例如
In the GNOME Terminal, Bash does smart auto-completion. For example
apt-get in<TAB>
变成
apt-get install
在 Emacs shell 模式下,即使在我明确获取 /etc/bash_completion
之后,这种自动完成功能也不起作用.上面的示例作为 in
或使用当前目录中的文件名自动完成而不是有效的 apt-get
命令选项.据推测,这是因为 Emacs 正在拦截 Tab 按键.如何在 shell-mode
中启用智能自动完成?
In Emacs shell-mode, this auto-completion doesn't work, even after I explicitly source /etc/bash_completion
. The above example sticks as in
or auto-completes with a filename in the current directory rather than a valid apt-get
command option. Presumably, this is because Emacs is intercepting the Tab key-press. How do I enable smart auto-completion in shell-mode
?
推荐答案
我知道这个问题已经三年了,但我也一直有兴趣解决这个问题.一个网络搜索将我定向到一个使 Emacs 在 shell 模式下使用 bash 完成的 elisp.无论如何,它对我有用.
I know this question is three years old, but it's something that I've also been interested in solving. A Web search directed me to a piece of elisp that makes Emacs use bash for completion in shell mode. It works for me, in any case.
在 https://github.com/szermatt/emacs-bash-completion 中查看.
这篇关于Emacs shell 模式下的 Bash 自动补全的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!