Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The equivalent of a GUI "Quick Open" in Emacs on CLI?

Tags:

emacs

The title probably doesn't describe this question well enough. Many GUI-based editors allow you to press a key combination and then start typing a file name (anywhere, in any directory) and as you're typing, a list is filtered down of all the files matching that pattern, in realtime. If you hit enter, the currently highlighted file will be opened, or if you hit the UP or DOWN arrows you can change the selection. For example, in TextMate and Sublime Text 2 (on OS X) this is achieved by hitting CMD+T.

enter image description here

Now I know about find-dired and find-grep in Emacs, but is there anything else available that's a little more instant? The annoying thing with dired is that you have to hit enter and perform the search in order to see if the filename was correct. This is ok if you know the filename, but not so good when you're going based on educated guesses. It seems like something emacs could be suited to. Set the directory to index (just once) then when searching filter the index using a Radix tree search or some such, using a split window to show files and responding to the UP and DOWN arrows to adjust the selection.

Anything out there? :)

like image 807
d11wtq Avatar asked Feb 24 '23 00:02

d11wtq


1 Answers

ido-mode is perfect for this. It has countless useful applications, including fuzzy filename matching as you demonstrated in your picture.

ido-mode running in my emacs

Some things to get started:

  • What You Can Learn From ido-mode
  • EmacsWiki article
  • Introduction to Ido Mode
like image 85
Jon Gauthier Avatar answered Mar 04 '23 21:03

Jon Gauthier