Fork me on GitHub
#vim
<
2022-02-21
>
zxspectrr15:02:45

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

zxspectrr15:02:05

I'd like get-input to be highlighted in green basically

Noah Bogart16:02:08

i don't know how neovim tree-sitter works, but i had to change the syntax files i downloaded

Noah Bogart16:02:32

i can paste the changes in here to show what i did

Nikolay Kotsev16:02:13

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.

zxspectrr16:02:37

sorry I'm a little lost now

Nikolay Kotsev16:02:13

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.

zxspectrr18:02:21

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

zxspectrr18:02:47

i think https://github.com/guns/vim-clojure-highlight is what i'm looking for but doesn't seem to play with conjure

🔥 1
Noah Bogart18:02:20

That should work with conjure, they don't overlap I don’t think

Noah Bogart18:02:29

I use both at least and haven't noticed an issue

zxspectrr18:02:45

I think it only works with fireplace...

Noah Bogart18:02:59

Oops you're right. I thought you linked the same static files I linked earlier

Noah Bogart18:02:11

When I get back in my computer I can send you my changes to make it highlight properly

zxspectrr18:02:49

do you use conjure?

Noah Bogart18:02:33

Yes and lsp using coc

Leaf Garland18:02:12

You say you are using treesitter. Did you install the clojure treesitter modules? If so it's likely the highlighting will be from treesitter.

zxspectrr18:02:59

i installed the clojure module via :TSInstall clojure

zxspectrr18:02:34

do you think that's conflicting with vim-clojure-highlight ?

Leaf Garland01:02:17

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.

Leaf Garland01:02:40

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

zxspectrr14:02:02

that command didn't do anything

zxspectrr14:02:18

treesitter is installed along wiht the clojure module but perhaps it's not configured properly

Leaf Garland23:02:20

Perhaps. The main thing it to tell tree sitter that you want to enable the highlight module.

zxspectrr14:02:11

I hadn't activated treesitter, once I created my lua file it worked

zxspectrr14:02:15

thanks for your help