Highlight definition of occurences of a function/immutable in LightTable

Issue

Is it somehow possible to highlight all occurrences of a function and (jump to) its definition in the Clojure-editor LightTable?

If I for example have the following code

(defn a [x] (* x x))
(str "abc" (a 4))
;; ... some more code  ...
(a 2)

When I’m with my cursor at one of the a’s, I’d like to have all a’s that are related to the function beeing highlighted. So the a in the String abc should not be highlighted.

It would be also nice to jump directly to the point where a is defined. (I tried Strg + ., but that did not work)

Solution

The highlighting functionality is implemented through a plugin, just go to “Plugin Manager” and search for match-highlighter. If you don’t like the style you just need to fork the project and tweak the CSS

If you fancy to collaborate:

https://github.com/Gozala/lt.plugins.match-highlighter

The jump to definition hasn’t being implemented yet afaik, keep an eye on the list of plugins if you fancy something else

https://github.com/LightTable/plugin-metadata

Answered By – Jaime Agudo

Answer Checked By – Terry (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.