禁用特定命令的 ido 模式?
我已经使用 ido-mode 几个月了,并且 ido-everywhere 都打开了,总体来说我对此非常满意。不过,有一件事我希望我能改变。当我输入 Cu Mx shell 以创建具有特定名称的新 shell 缓冲区时,ido 会为我提供所有打开缓冲区的完成列表。如果我选择其中一个,则会在该缓冲区中启动一个新 shell,并将其置于 shell 模式,无论它包含什么。很难想象这有什么有用的用例。
有没有办法只为 shell 命令停用 ido 模式? (当然,以及我将来可能会偶然发现的任何其他类似命令。)
I've been using ido-mode for a few months, with ido-everywhere turned on, and am generally pretty happy with it. There's one thing I wish I could change, though. When I type C-u M-x shell to create a new shell buffer with a specific name, ido offers me a completion list of all of my open buffers. If I choose one, a new shell is launched in that buffer and it's put into shell-mode, no matter what it contains. It's hard to imagine a useful use case for this.
Is there a way to deactivate ido-mode for the shell command only? (As well as any other similar commands I may stumble across in the future, of course.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
呵呵,事实证明,无论您是否启用了 ido-everywhere,您都会得到相同的完成选项。
没有内置的方法可以做你想做的事。
ido-mode
仅提供钩子,以便您能够覆盖find-file
行为是否被ido
接管。read-buffer
当前总是被ido-everywhere
覆盖。幸运的是,一点 Emacs lisp 就可以得到你想要的东西:
对于任何其他你不想要的命令,可以通过在 .emacs 中添加一个新表达式来自定义缓冲区选择的
ido-everywhere
:Heh, it turns out you'll get the same completion choices whether or not you have
ido-everywhere
enabled.There's no built-in way to do what you want.
ido-mode
only provides hooks for you to be able to override whether or not thefind-file
behavior is taken over byido
or not. Theread-buffer
is currently always overridden byido-everywhere
.Luckily, a little Emacs lisp can get what you want:
And for any other command you don't want following
ido-everywhere
for buffer selection can be customized by simply adding a new expression to your .emacs: