RRethy / vim-illuminate

illuminate.vim - (Neo)Vim plugin for automatically highlighting other uses of the word under the cursor using either LSP, Tree-sitter, or regex matching.
2.16k stars 47 forks source link

Words containing dashes are treated as 2 different words #38

Closed sefechit closed 4 years ago

sefechit commented 4 years ago

Words which contain dashes (happens a lot when working with CSS) such as: text-decoration and border-top, are treated as 2 different words. i.e. it illuminates the first word, the dash is being ignored, and then it illuminates the second word. I must add that it doesn't happen with words which contain underscores, only with dashes.

Thank you in advance :)

RRethy commented 4 years ago

This is due to your :h 'iskeyword' option, vim-illuminate will use it to determine word boundaries. Running :set iskeyword+=- will get the desired behaviour. I think you (or a plugin) have modified 'iskeyword' and removed - from it since the dash will be there by default so double check everywhere to ensure you aren't messing with 'iskeyword' elsewhere.

sefechit commented 4 years ago

Thank you very much, you were right!