[ANN] vim-clojure-highlight

89 views
Skip to first unread message

guns

unread,
Jan 14, 2014, 11:39:37 AM1/14/14
to vimcl...@googlegroups.com, Oskar Kvist
Hello,

I'm sure many of you miss the DynamicHighlighting feature from
VimClojure. vim-clojure-highlight is essentially a reimplementation of
that feature as a fireplace plugin:

https://github.com/guns/vim-clojure-highlight

For those who are unfamiliar, this plugin highlights referred and
aliased vars from other namespaces in the same fashion as the vars in
clojure.core.

As suspected, writing this was quite straightforward, and also appears
to be reasonably fast.

This has only been tested on a console version of vim 7.4.131 on Linux,
so if this plugin does not work smoothly for you, please let me know!

Cheers,
guns

Oskar Kvist

unread,
Feb 11, 2014, 1:19:07 PM2/11/14
to vimcl...@googlegroups.com, Oskar Kvist
Nice work!

Any reason you don't highlight local stuff? Like if I do a (defn something ...), something will become colored right there. Too much color? Anyway, if you change your mind, this will save you 2 min:

(defn- local-refs [ns]
  (map (fn [[name var]] [(str name) var])
       (ns-publics ns)))

guns

unread,
Feb 11, 2014, 5:19:36 PM2/11/14
to vimcl...@googlegroups.com
On Tue 11 Feb 2014 at 10:19:07AM -0800, Oskar Kvist wrote:
> Nice work!
>
> Any reason you don't highlight local stuff? Like if I do a (defn something
> ...), something will become colored right there. Too much color? Anyway, if
> you change your mind, this will save you 2 min:
>
> (defn- local-refs [ns]
> (map (fn [[name var]] [(str name) var])
> (ns-publics ns)))

Yes, highlighting local vars makes the buffer a little too colorful for
me, but I'm happy to make that configurable. Please give me a couple of
days and I'll make some time to add that to vim-clojure-highlight.

Cheers,
guns

Oskar Kvist

unread,
Feb 13, 2014, 1:09:20 PM2/13/14
to vimcl...@googlegroups.com, Oskar Kvist
I noticed that if I don't have `lein repl` running, it takes a while for vim-clojure-highlight to fail. It is a bit annoying. Can something be done about that?


On Tuesday, January 14, 2014 5:39:37 PM UTC+1, guns wrote:

guns

unread,
Feb 13, 2014, 1:14:26 PM2/13/14
to vimcl...@googlegroups.com
On Thu 13 Feb 2014 at 10:09:20AM -0800, Oskar Kvist wrote:
> I noticed that if I don't have `lein repl` running, it takes a while for
> vim-clojure-highlight to fail. It is a bit annoying. Can something be
> done about that?

Sounds like you probably have vim-classpath installed. I'll look into it
later today!

guns

Oskar Kvist

unread,
Feb 14, 2014, 1:20:39 AM2/14/14
to vimcl...@googlegroups.com
Yes, I have vim-classpath.

guns

unread,
Feb 25, 2014, 9:46:46 PM2/25/14
to vimcl...@googlegroups.com, Oskar Kvist
On Thu 13 Feb 2014 at 10:09:20AM -0800, Oskar Kvist wrote:
> I noticed that if I don't have `lein repl` running, it takes a while for
> vim-clojure-highlight to fail. It is a bit annoying. Can something be
> done about that?

Neil Kirsopp added a patch¹ that fixes the issue (he added this last
week, but I unfortunately did not notice).

I don't use vim-classpath, so I can't confirm, but I presume it works
for him. Sorry for the long turnaround!

guns

¹ https://github.com/guns/vim-clojure-highlight/pull/2

guns

unread,
Apr 2, 2014, 4:22:25 AM4/2/14
to vimcl...@googlegroups.com, Oskar Kvist
Okay, vim-clojure-highlight now highlights local vars by default. It
took me a little longer than a couple of days (sorry).

https://github.com/guns/vim-clojure-highlight

And actually, now that it's on, I rather enjoy it. One nice unforeseen
benefit is that ^:private local vars are never highlighted, so the
absence of color now signals that a var is private.

Thanks for the suggestion!

guns
Reply all
Reply to author
Forward
0 new messages