Closed has2k1 closed 6 years ago
IMO glancing at the code should immediately make it clear where strings are located. Doing something like you propose will make that much harder.
I have since thought about this and I think the best place for it is in a custom after/syntax/python.vim
. There isn't a nice way to do it that would make it portable across different themes. Plus there may be performance implications as vim warns about using look-around regexes, and they would be indispensable for this task.
I will implement this for myself and put the code up somewhere.
Github's highlighting of raw strings makes regexes more readable. For example:
The above regex may not give the full picture, but we make some sense of the highlighting. You have four colours for:
abc
, and grouping chars(), (?: )
^, $
, and character classes[a-zA-Z0-9], [\s\w\d], \W, .
*, +, ?, {3,4},
, and special characters|, ^
\[\], \1