Is it possible to ignore whitespaces when highlighting?

I got the following situation:

  1. I turned on the Whitespaces highlighter
  2. I set the face to be quite dim
  3. In a markdown file, the whitespaces are highlighted together with the “list” symbol

Instead, I would like to highlight the list symbol, e.g. - or *, but not the whitespaces surrounding it. Currently, the markdown filetype regex to identify lists includes the spaces (and has to). The same issue appears, of course, with headers and so on.

In the screenshot below, I want the light blue whitespaces to be as dim as the other ones.

image

Is there a way I can make this work? Maybe with a regex capturing group (sub group) for the highlighting?

Thanks!

You can highlight the foreground of whitespaces as light blue with the final +f switch.

2 Likes

Perfect, thank you!
For reference: set-face global Whitespace rgb:4c566a,default+f as per :doc faces.