Syntax highlighting stuff not in Clojure

48 views
Skip to first unread message

Oskar Kvist

unread,
Jul 10, 2013, 11:23:19 AM7/10/13
to vimcl...@googlegroups.com
Hi!

It would be nice to have all the functions and macros I define myself being highlighted as if they were clojureFunc and clojureMacro. What I do if I really want something highlighted is just add it in my vimrc, but that is not really feasible for every new function and macro. Also, there are problems with namespace qualifiers. I asked a related question on SO [1], and as you can see, kotarak said VimClojure had "dynamic highlightning". Maybe something like that could be done with vim-fireplace too? Unfortunately I'm not good enough at VimScript to do it myself. :(

guns

unread,
Jul 10, 2013, 7:11:26 PM7/10/13
to vimcl...@googlegroups.com
On Wed 10 Jul 2013 at 08:23:19AM -0700, Oskar Kvist wrote:

> Hi!
>
> It would be nice to have all the functions and macros I define myself
> being highlighted as if they were clojureFunc and clojureMacro. What I
> do if I really want something highlighted is just add it in my vimrc,
> but that is not really feasible for every new function and macro.
> Also, there are problems with namespace qualifiers. I asked a related
> question on SO [1], and as you can see, kotarak said VimClojure had
> "dynamic highlightning". Maybe something like that could be done with
> vim-fireplace too? Unfortunately I'm not good enough at VimScript to
> do it myself. :(

VimClojure had this feature, and it was really quite nice. It would not
be too difficult to add this as a fireplace.vim plugin, and it has been
on my TODO list.

If you're willing to wait an unspecified amount of time, this plugin
will eventually materialize. :)

guns

Oskar Kvist

unread,
Jul 11, 2013, 12:20:55 PM7/11/13
to vimcl...@googlegroups.com
Hehe, OK.

Tim Pope

unread,
Jul 13, 2013, 10:17:56 PM7/13/13
to vimcl...@googlegroups.com
I actually tried to knock this out early in fireplace's development.
Actual implementation was pretty simple, but getting the REPL
connection up *before* syntax highlighting was activated was a tough
nut to crack.
> --
> You received this message because you are subscribed to the Google Groups
> "vimclojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vimclojure+...@googlegroups.com.
> To post to this group, send email to vimcl...@googlegroups.com.
> Visit this group at http://groups.google.com/group/vimclojure.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

guns

unread,
Jul 13, 2013, 10:34:20 PM7/13/13
to vimcl...@googlegroups.com, tp...@tpope.net
On Sat 13 Jul 2013 at 10:17:56PM -0400, Tim Pope wrote:

> I actually tried to knock this out early in fireplace's development.
> Actual implementation was pretty simple, but getting the REPL
> connection up *before* syntax highlighting was activated was a tough
> nut to crack.

Did you find the syntax "repaint" too slow? I would appreciate a version
that makes a couple of extra scans through the buffer even if not
optimal.

I'm sure I'm not the only one!

guns

Meikel Brandmeyer

unread,
Jul 15, 2013, 5:44:03 AM7/15/13
to vimcl...@googlegroups.com, tp...@tpope.net
Hi,
Here is what VimClojure did:

The definition of additional syntax items happens only once during the buffer initialisation. So redrawing should not be an issues (besides maybe adding to much syntax items). The order of syntax highlighting and buffer init can be a problem. I encountered this only on Windows, though. So I added a check in the syntax code to do the buffer init if not done already. Note: buffer init != filetype plugin. The context used by VimClojure for doing backend stuff is just some buffer local variables. It doesn't really care when or where they are set. This worked without problems for me.

Meikel

Reply all
Reply to author
Forward
0 new messages