Skip to main content

Jump around (Emacs version)

This week someone on reddit posted a link to evil-textobj-syntax, which defines an object based on the used face of the text. I really like the idea, because sometimes there is no text object to choose from, but some mode already implicitly defined one via syntax highlighting. So I went ahead and implemented it for objed. Here is an example where I’m using it (parentheses are dimmed/highlighted by paren-face-mode):

demo

As with any object, defining it, means you can apply all available actions to the object. For example quickly jump to an object on the screen using avy:

demo2

When you want to get an overview of face objects you have seen recently (they must have been highlighted by emacs) or you want to jump to an instance which isn’t on the screen, you can try the command objed-occur. In the following example I jump to some org-mode link (using ivy for completion):

demo3