This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-02-04
Channels
- # announcements (7)
- # beginners (37)
- # boot (6)
- # calva (13)
- # cider (13)
- # cljdoc (52)
- # cljs-dev (9)
- # clojure (117)
- # clojure-europe (3)
- # clojure-italy (12)
- # clojure-nl (21)
- # clojure-russia (8)
- # clojure-spec (77)
- # clojure-uk (20)
- # clojurescript (142)
- # community-development (6)
- # cursive (5)
- # datomic (13)
- # emacs (9)
- # figwheel-main (20)
- # fulcro (33)
- # graphql (11)
- # instaparse (6)
- # klipse (1)
- # off-topic (7)
- # om (8)
- # quil (7)
- # re-frame (11)
- # reagent (39)
- # reitit (10)
- # shadow-cljs (36)
- # spacemacs (3)
- # test-check (3)
- # tools-deps (83)
- # utah-clojurians (31)
- # vim (14)
i have something of an interesting question for y'all: i currently use the vim-clojure-static syntax file, but I've modified it to highlight all function calls and function definitions as functions. To do so, I had to remove the Sexp understanding and the superfluous parens/bracket/braces checking
Looking back over it, I feel like there's gotta be a way to combine these. It's really helpful to me to highlight function calls (that is, any string immediately after an open parenthesis), but I don't want to lose out on the other features
I've written it like this:
" Inline functions must defined first, so all other matches overwrite
syn region Paren transparent start='(' end=')'
syn match clojureInlineFunction "(\@<=\K\k\+" contains=Paren
syn match clojureParen "[()\[\]{}]"
Any syntax highlighting wizards in here?
sure, hi link is what I want to do at the end, but I have to match on a sequence of character to highlight those first
the goal is to match against \K\k+
immediately after a parenthesis without overwriting the match against clojureParen
not quite, but I think I solved it. Here we find the issue of doing something early last year and only now thinking "Why did I do that?" and then stumbling on the easy answer, lol
For some reason, last year when I tried this I struggled with matching against the function name after the parenthesis without matching against the parenthesis. I solved this by removing the clojureSexp and clojureSymbol matching
Turns out what I'm looking for is as "easy" as:
syntax match clojureInlineFunction "(\@<=\v%([a-zA-Z!$&*_+=|<.>?-]|[^\x00-\x7F])+%(:?%([a-zA-Z0-9!#$%&*_+=|'<.>/?-]|[^\x00-\x7F]))*[#:]@<!"
immediately after the clojureSymbol definition
it sadly reuses the expensive regex, so if anyone knows how to embed the clojureSymbol match into a match against open parens, I'm all ears