Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

emacs

ido-mode

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?

like image 503
d11wtq Avatar asked Sep 20 '11 02:09

d11wtq


People also ask

What is Ido mode Emacs?

ido-mode enhances emacs switch buffer command and opening file command. It automatically show list of choices as you type (no need to press Tab first). Alt + x ido-mode. Toggle it on/off.

How do I navigate folders in Emacs?

In Emacs, type M-x dired. You will be prompted for the directory to open. Type in the directory to display, or press Return to open the default directory.


2 Answers

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.

like image 80
Michael Markert Avatar answered Oct 17 '22 17:10

Michael Markert


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.

like image 27
d11wtq Avatar answered Oct 17 '22 19:10

d11wtq