Torstein Johansen on Dumb-jump

Torstein Johansen has a short video on one of my favorite navigation packages. These days, everyone appears to want Emacs to offer the completion of those LongAndStupidFunction.names beloved by Javanistas and others. You can’t blame them, of course, but that means running LSP or Eglot. Fortunately, the languages I use don’t have sesquipedalian function names or calling sequences so I’ve never bothered setting up LSP or Eglot.

One thing I do like to do, though, is jump from a class or function reference to its definition. The traditional way of doing this is with a TAGS file but means keeping the TAGS file in sync as you make changes. That’s okay for a static project but doesn’t work well when a project is under active development.

My long term solution to this is dumb-jump. I’ve been using it for the last six years and wrote about it here. It really is the sweat spot for me. Johansen’s video discusses dumb-jump and how he uses it. He discusses something I didn’t know about. Apparently there is now an integration with the Xref framework. That’s nice because it gives you a consistent way of dealing with cross reference navigation. I use the older style that defines custom keybindings. Here’s my configuration

(use-package dumb-jump
  :ensure t
  :bind (("M-g o" . dumb-jump-go-other-window)
         ("M-g j" . dumb-jump-go)
         ("M-g b" . dumb-jump-back)
         ("M-g q" . dumb-jump-quick-look)
         ("M-g x" . dumb-jump-go-prefer-external)
         ("M-g z" . dumb-jump-go-prefer-external-other-window))
  :config (setq dumb-jump-selector 'ivy))

in case you want finer control but I like the Xref integration that provides the common operations in a consistent way.

Regardless, dumb-jump is a really useful package. Johansen’s video is only 7 minutes long so it’s well worth a few minutes of your time.

This entry was posted in General and tagged . Bookmark the permalink.