How to pick directory (not file) in IDO mode, emacs-24
Asked Answered
N

3

24

IDO mode is awesome. It's essential to know the basic shortcuts, especially the escape hatch Ctrl-f (introduction-to-ido-mode/) which gets you out of ido-mode.

In dired, if I want to copy a file to a directory, I can't seem to use ido to pick the directory, not can I even use the current ido directory that I've navigated to. There should be some way to say "pick directory" or at least enable the ctrl-f option to use the current spot in IDO. Does anybody know how to do this? (yes, you can disable ido mode for dired, but that is not what I want to do).

Noseband answered 26/8, 2012 at 20:12 Comment(0)
E
37

You can use C-j, which is bound to (ido-select-text) and selects the buffer currently named by the prompt, which might be a directory as well.

Equinoctial answered 16/10, 2012 at 13:34 Comment(0)
A
28

You can use "C-d" in ido mode, minibuffer

Atp answered 6/9, 2013 at 8:42 Comment(4)
Not sure the reason for the downvote, this worked for me. C-d is easier to remember than C-j for choosing a directory.Bindman
"C-d" is bound to "delete-char" in the default Emacs keybindings, so this will not work for most people.Overload
@Bklyn: I don't think that's the case. C-d is bound to ido-magic-delete-char in the minibuffer, and the documentation says "If at end of user input, perform magic actions: C-x C-f ... C-d enter 'dired' on current directory."Greenman
Weirdly, this didn't work for me (Emacs 26.1). I verified with "C-h k" that C-d is actually bound to ido-magic-delete-char in an ido minibuffer. "C-j" answered above does work.Clayson
C
7

An alternative is to enable

(setq ido-show-dot-for-dired t)

and then you can open directories by opening the . file which will always be the first entry for a directory that you descend into.

Chung answered 27/12, 2015 at 0:9 Comment(1)
I don't like that C-x C-f bound to ido-find-file does not accept dir as input, but this solution works acceptablySikko

© 2022 - 2024 — McMap. All rights reserved.