views:

837

answers:

7

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.

A: 

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.

p4bl0
The problem is that the terminal emulator and the shell are not aware of each other. Some hack around parsing the prompt could be done, but that's a hack and is likely to fail. (Consider being ssh'd in. The terminal emulator sees your local filesystem, but the shell sees the remote filesystem. Let the confusion and incorrect results begin...)
jrockway
+1  A: 

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.

Steve K
+2  A: 

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.

Ghoti
A: 

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.

Ryan Thompson
A: 

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.

zpinter
+4  A: 

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

pgas
Awesome work! Any thoughts of putting this up on something like github?
zpinter
A: 

Awesome work!

Thanks! I uploaded a newer version with (non-persitent) history.

Any thoughts of putting this up on something like github?

I'm not against the idea...but why?

pgas