Closed subnut closed 3 years ago
I like the idea of *:blacklist
so I added that and you can use *
to specify any filetype for the whitelist. However, I didn't implement full regex matching since I don't think matching filetypes by regex is useful.
I did not add the ['.*[cC]omment.*']
since that's a non-trivial change, and you should only need Comment
in that case since the highlight groups should use something along the lines of hi link goComment Comment
which vim-illuminate correctly picks up as both goComment
and Comment
. I don't see the use-case for regex matching on the highlight group.
This feature is also undocumented currently.
However, I didn't implement full regex matching since I don't think matching filetypes by regex is useful.
@RRethy It is useful :smiley: For example, I use vim-lsp for python files. vim-lsp uses the language server to determine which things to highlight, and is generally cleverer than this plugin. So I have added python to the blacklist. Works!
But then, I view a function definition in a floating window. vim-lsp (helpfully) adds .lsp-hover
at the end of the &syntax
so that plugins can use that information and act accordingly... But what happens? this plugin doesn't!
Hope you understand what I mean... my english is very poor... :sweat_smile:
Hmmm I get what your saying, I didn't consider this scenario. I'll reopen and think about this.
Tip: For regex-matching, use a =~ b
instead of a == b
, in case you didn't already know :sweat_smile:
If you didn't know, I suggest looking at :help expr-=~
Thank you 😄 , I prefer using =~#
though to avoid uncertainty around case matching. The main issue I have is around performance. Since filetype matching is done using a dictionary where filetypes are checked for existence, if I add regex matching, I would need to loop over the keys instead of using has_key
. Since this is checked a lot, this might hurt performance which I need to investigate.
The main issue I have is around performance.
Hmm..... we could use a new variable, then.
Say, g:Illuminate_ftblacklist_regex
?
Then it would simply be a single string to check! :tada:
EDIT: I've tried to implement this in #55
It's pretty annoying when comments are getting highlighted. I can disable them for each filetype manually in the vimrc, but it would be better if you allowed regex.
Then we could do something like:
i.e.
*
=> For all filetypes:blacklist
=> blacklist'.*[cC]omment.*'
=> match any highlight group containingcomment
orComment
in it's name