1

I found this package for the bash shell that lets you quickly jump between commonly used folders: https://github.com/gsamokovarov/jump

I use it all the time now.

Jump uses fuzzy matching to find the desired directory to jump to. This means that your search terms are patterns that match the desired directory approximately rather than exactly. Typing 2 to 5 consecutive characters of the directory name is all that jump needs to find it.

Is there a way to use this from inside of Emacs or something equivalent? One option would be to jump to a folder in the shell, then open emacs in that directory. However, it seems like a lot of people just leave emacs open all the time and navigate to files within emacs.

Edit: Thanks! I didn't realize you could do fuzzy matching in Emacs.

By jump I mean, say I have two folders

/home/user/python/space/satellite_plotter/

/home/user/c_programs/games/pacman/

In bash with jump, if I am working in the first folder I can just type "j pac" and it will navigate to the second folder. It keeps track of often visited folders and then performs fuzzy matching on this list. I just don't know of a way to do this as quickly in Emacs.

1 Answer 1

0

What do you mean by jump to a folder (directory), in Emacs?

Do you mean just change the value of default-directory? Do you mean open Dired on that directory? For the former, just use M-x cd (or bind it to a key). For the latter, just use C-x d.

You can use fuzzy matching for any or all inputs you type to Emacs. Even in vanilla Emacs there is now a completion style (option completion-styles) called flex that provides a simple kind of fuzzy matching.


UPDATE after your comment:

  • For jumping among recently visited files (and directories), use library recentf.

  • For jumping among buffers in the current session, just use C-x b.

  • For jumping among specific places in buffers or files, use Emacs bookmarks. If you use Bookmark+ then you can quickly bookmark positions without needing to name them, and the bookmarks can be temporary (not persist across Emacs sessions), if you like.

2
  • Thanks! I didn't realize you could do fuzzy matching in Emacs. By jump I mean, say I have two folders -/home/user/python/space/satellite_plotter/ -/home/user/c_programs/games/pacman/ In bash with jump, if I am working in the first folder I can just type "j pac" and it will navigate to the second folder. It keeps track of often visited folders and then performs fuzzy matching on this list. I just don't know of a way to do this as quickly in Emacs.
    – Hunter
    Apr 2, 2021 at 13:16
  • Please put all such info in the question itself. Comments can be deleted at any time.
    – Drew
    Apr 2, 2021 at 15:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.