Emacs ido-mode and creating new files in directories, it keeps changing the directory while I'm typing

一世执手 提交于 2019-12-03 05:32:18

问题


When using ido-mode in emacs, it tends to get in my way when I'm trying to create a new file inside a directory, using: C-x C-f ( start typing a new filename, which doesn't yet exist ) RET

Ordinarily this should create a new file, but when I have ido mode, I have to type the new filename really quickly, otherwise ido-mode decides to move me into a directory that has a file with a matching name, causing me to open that file, instead of creating a new file.

Does anybody know how to force ido-mode to avoid looking in directories other than the one you're currently in?


回答1:


You can disable the merging (the "looking in other directories" in ido vulgo) with

(setq ido-auto-merge-work-directories-length -1)

but you can also undo the merge with C-z in ido.




回答2:


Doing this really helps. Basically use ido-mode up until you get to the correct directory, then hit C-f again to get out of ido-mode as you type the new filename.

C-x C-f navigate to directory C-f enter new filename RET.




回答3:


Use C-j to tell ido to input what you have typed rather than the first completion. This is also mentioned on emacswiki.



来源:https://stackoverflow.com/questions/7479565/emacs-ido-mode-and-creating-new-files-in-directories-it-keeps-changing-the-dire

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!