-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to highlight namespace of a keyword separately? #24
Comments
There isn't a built-in way currently, This is something I would like to add at some point, but just haven't had the time. However in the mean time, you can place something like this in your config: syntax match clojureKeywordNs contained "\v:{1,2}[^/]+\ze/"
syntax match clojureKeywordNsSep contained "/"
syntax match clojureKeyword "\v<:{1,2}([^ \n\r\t()\[\]{}";@^`~\\/]+/)*[^ \n\r\t()\[\]{}";@^`~\\/]+:@1<!>" contains=clojureKeywordNs,clojureKeywordNsSep
" Replace these lines to pick whatever colours you want.
highlight link clojureKeywordNs Todo
highlight link clojureKeywordNsSep Warning |
Should I create a PR? |
Please do if you would like to. (I can see that you already have. 😃 Usually I respond much quicker, but I've been pretty busy recently, so sorry for the delay.) |
I created a PR long time ago. I played around with the testing macro and I think I should remove it completely and replace it with plain In the current state of the PR I tried to play around with the macro and just make it barely working enough for my namespace highlighting (it's mergeable nevertheless but I'd like to remove the testing macro as I don't see much value from it). From the time of my PR I used my own version of the plugin and I think I didn't find any problems with it at all.
So in this example |
Hi, thank you for your work on this, and sorry for the (painfully slow) amount of time it has taken me to get around to looking at it. I've been using it for a little while and it has been working well for me. It would be nice to have namespaced maps highlighted correctly too, but this is already above and beyond what I could have hoped for. I completely agree with replacing the testing macro, so please feel free to replace it if you like. (I had already redone the indentation tests in #26, but hadn't got around to the syntax tests.) Once again, thank you! I will merge #27 now. Edit: if you submit any more PRs here, I promise I won't make you wait as long. 😉 |
Hey.
I use CIDER in Spacemacs and they do this:
How can I achieve that in vim/nvim?
The default behavior in nvim gives me this:
When I try to do define my own syntax for highlighting part of a keyword I can't understand how to do it (copied from this project) and I end up highlighting the whole keyword or nothing at all:
The text was updated successfully, but these errors were encountered: