Emacs ido-style shell
Asked Answered
C

7

20

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.

Calabar answered 11/7, 2009 at 2:51 Comment(5)
I've often wished more applications behaved like ido-mode.Tobiastobie
Why ever leave emacs? :) eshell?Tarrel
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.Ebony
Not directly related, but there is smex ( github.com/nonsequitur/smex/tree/master ) for executing extended commands (M-x)Thynne
"outside of emacs"? What is this madness you speak of? :)Agraffe
I
19

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

Isolde answered 9/1, 2010 at 22:34 Comment(1)
Awesome work! Any thoughts of putting this up on something like github?Calabar
E
3

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.

Easement answered 30/7, 2009 at 21:36 Comment(0)
I
2

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.

Impossibly answered 14/7, 2009 at 22:47 Comment(0)
C
2

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.

Calabar answered 26/12, 2009 at 17:43 Comment(0)
B
0

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.

Bedroll answered 13/7, 2009 at 11:39 Comment(1)
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...)Ebony
T
0

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.

Transect answered 21/10, 2009 at 7:6 Comment(0)
S
0

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.

Snocat answered 14/1, 2020 at 13:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.