Use bookmarks to jump to files or directories

In Emacs you can bookmark files and directories (and lots of other things) so that you can quickly jump to them (similar to a browser’s bookmarks).

The basics are easy. Use C-x r m to make a bookmark to the file or directory you are currently visiting. You’ll be prompted for an optional name for your bookmark. For example, I use names starting dir- for bookmarks to directories so that they all appear together in the bookmark list.

You can use C-x r b to go to a bookmark, and you’ll prompted for the name of the bookmark. Use C-x r l to list all of the bookmarks.

There is a bookmarks+ package which adds extra features to the normal bookmarks, but I’ve not found that I need those extras so far.

  • Jason May

    The bookmarks record position in file. Which is nice, except that sometimes I want a bookmark that is always at the *end* of the file. Possible?

    • NoonianAtall

      You could do that with a custom bookmark type and handler that would always jump to the end of the file. It’s not too hard. You might look at my code in the org-bookmark-heading package for an example.

  • NoonianAtall

    If you use Org-mode, you’ll probably find the org-bookmark-heading package useful. It’s on MELPA.