This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-02-21
Channels
- # announcements (4)
- # architecture (161)
- # autochrome-github (7)
- # babashka (61)
- # beginners (42)
- # calva (24)
- # cider (22)
- # clj-kondo (28)
- # cljs-dev (8)
- # clojure (88)
- # clojure-art (2)
- # clojure-dev (7)
- # clojure-europe (43)
- # clojure-germany (2)
- # clojure-nl (2)
- # clojure-uk (4)
- # clojurescript (32)
- # core-async (41)
- # cursive (32)
- # datahike (6)
- # datomic (9)
- # emacs (22)
- # events (2)
- # fulcro (10)
- # graphql (1)
- # nextjournal (16)
- # off-topic (9)
- # overtone (1)
- # pathom (16)
- # polylith (5)
- # quil (7)
- # rdf (1)
- # re-frame (7)
- # reagent (22)
- # releases (2)
- # remote-jobs (1)
- # reveal (12)
- # sci (1)
- # shadow-cljs (12)
- # specter (20)
- # sql (6)
- # tools-deps (21)
- # vim (26)
- # xtdb (10)
hi, i'm having a play with conjure and vim. Does anyone know why i'm getting different colour hilighting for a user defined function call vs a call to a function in the core lib? Eg (my-fun
vs (reduce
. I've put a screenshot below
I'm using conjure neovim treesitter and gruvbox-material
i don't know how neovim tree-sitter works, but i had to change the
syntax files i downloaded
i can paste the changes in here to show what i did
If I recall correctly the default highlighting comes from https://github.com/clojure-vim/clojure.vim and to be precise https://github.com/clojure-vim/clojure.vim/blob/master/syntax/clojure.vim#L32 . In there there is a g:clojure_syntax_keywords
variable that is checked for similar list to the one shown. You can extend it with anything you want, but the new keywords start getting highlighted on redraw of the buffer.
I’m not aware of a dynamic solution for this, but would be glad to check it out if somebody has any suggestions.
Sorry. I tend to overcomplicate things. Basically as far as I know it is not supported by default. You should be able to use the forementioned global variable if you want to write something on your own.
they seem to have just put a hard coded list of core functions. I was kind of expecting any word prefixed with (
to be highlighted, it seems quite strange to me
i think https://github.com/guns/vim-clojure-highlight is what i'm looking for but doesn't seem to play with conjure
That should work with conjure, they don't overlap I don’t think
I use both at least and haven't noticed an issue
Oops you're right. I thought you linked the same static files I linked earlier
When I get back in my computer I can send you my changes to make it highlight properly
Yes and lsp using coc
You say you are using treesitter. Did you install the clojure treesitter modules? If so it's likely the highlighting will be from treesitter.
The tree sitter highlight module for clojure should highlight all function calls, as in the first element of a list, it doesn't need a repl connection like vim-clojure-highlight. It might be that your cooler scheme is not highlighting those differently to anything else.
Treesitter highlights start with TS, e.g. function is TSFunction
you could try changing that highlight group to see if it works :highlight TSFunction guifg=red
treesitter is installed along wiht the clojure module but perhaps it's not configured properly
Perhaps. The main thing it to tell tree sitter that you want to enable the highlight module.