19
votes

Is there a command line shell or shell customization that supports emacs-style ido find file? In emacs, I can navigate to a directory extremely quickly using C-x C-f and (ido-mode t).

Ideally, I'm looking for a solution that can be used outside of emacs. Though I'd be open for a way to quickly change directories within an eshell buffer.

7
I've often wished more applications behaved like ido-mode.James Sulak
Why ever leave emacs? :) eshell?seth
He said he uses eshell. I read the ido source code, and it's not really factored well enough to use from eshell easily. So, he will need to refactor ido and then bind it to eshell, if he chooses that route.jrockway
Not directly related, but there is smex ( github.com/nonsequitur/smex/tree/master ) for executing extended commands (M-x)ustun
"outside of emacs"? What is this madness you speak of? :)kjfletch

7 Answers

19
votes

Since I also wanted something like this, I tried to implement it as a bash completion function. Obviously it means. you have to use bash.

It is only lightly tested, so please feel free to try and report bugs /comments.

http://pgas.freeshell.org/shell/bash-ido

3
votes

Try the Z-shell. It has much better completion than bash. I must admit I haven't used it for a while though and stuck with bash because it's always available.

2
votes

Bash has an environment variable called CDPATH which can contain a list of directories to search when using the cd command. Also, check out the "Programmable Completion" and "READLINE" sections of the Bash manual. You should be able to cobble together something that works for you.

2
votes

The best I've been able to come up with so far is autojump. Still looking for a solution closer to ido, but autojump is a great little app.

0
votes

I know that some terminal emulator support extension, for instance rxvt-unicode can be extended with Perl scripts. I'm not sure since i never wrote an extension myself, but maybe what you want is doable this way.

If you want to have a look at some Perl scripts for urxvt there are some examples in /usr/lib/urxvt/perl with the default urxvt install on Debian.

0
votes

If you want ido completion in eshell or similar, it might be best to write a function that uses ido to read a directory, then inserts the command to cd to that directory into the shell buffer. I don't use eshell myself, so I couldn't comment on how to actually write this function, but it's an idea.

0
votes

fzf, the command-line fuzzy finder, adds fuzzy completion for bash and zsh.

According to the developer:

It's an interactive Unix filter for command-line that can be used with any list; files, command history, processes, hostnames, bookmarks, git commits, etc.

This is a portable solution (works on Linux, Mac, Windows), which has no dependencies.