emacs 创建新文件并启用 ido
我最近切换到 emacs 入门套件,其中包括 ido 包。
ido 有一个很好的功能,可以在查找文件时建议路径,这通常非常方便,除非尝试创建新文件。当新文件名与另一个路径中的建议匹配时,ido 会自动切换到该路径,假设这就是我想要的,但通常不是这样,我觉得这很烦人。
为了解决这个问题,我要么从 shell 中触摸 newfile,创建一个新的缓冲区并另存为,要么使用 Mx find-file 来获取原始行为。我当然可以再次将 Cx Cf 重新绑定到 find-file,但我必须喜欢 ido-find-file,我只是希望它在我显式键入路径时停止自动切换路径。
我想我可能可以在 ido-find-file 期间按一些简单的键来告诉它我正在查找的文件不存在并停止提出建议,或者我可以设置一些 var 以获得更理想的行为?
I reciently switched to emacs starter kit which includes the ido package.
ido has a nice feature that suggests paths when find-file which is usually very handy except when trying to create a new file. When the new file name matches a suggestion in another path ido automatically switches to that path assuming that's what I wanted, but usually its not and I find it annoying.
To workaround the issue I either touch newfile from shell, create a new buffer and save as, or M-x find-file to get the original behavior. I could of course rebind C-x C-f to find-file again but must of the time I like ido-find-file, I just want it to stop automatically switching paths when I type the path explicitly.
I figure there is probably some simple key I can press during ido-find-file to tell it that the file I'm looking for does not exist and to stop making suggestions, or some var I can set to get more desirable behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
尝试:
Cx Cf Cf
它应该将您从 ido 模式踢出,进入“正常”查找文件模式
Try:
C-x C-f C-f
It should kick you out of ido mode into "normal" find file mode
Cj 是您正在寻找的组合键。
C-j is the key combination you are seeking.
如前所述:速度快、使用Cj立即确认、使用附加Cf临时切换到传统模式都是有用的。
另外,当 ido 已经选择了备用文件路径时,您可以按 Cz 返回原来的位置并暂时禁用该行为。
As mentioned: being fast, using C-j to confirm immediately, and using and additional C-f to temporarily switch to the traditional mode are all useful.
Also, when ido has already selected an alternate file path, you can hit C-z to return where you were and temporarily disable that behavior.
相关问题的解决方案 - 不询问覆盖确认。
http://lists.gnu.org/archive /html/bug-gnu-emacs/2010-11/msg00226.html
A solution for a related problem - ido not asking overwrite confirmation.
http://lists.gnu.org/archive/html/bug-gnu-emacs/2010-11/msg00226.html
在 Fido 上,Mj 发挥了作用。
它绑定到
icomplete默认情况下 -fido-exit
。On Fido, M-j does the trick.
It's bound to
icomplete-fido-exit
by default.