CodeblockCustomizer
CodeblockCustomizer copied to clipboard
Suggestion to improve existing text-only highlighting features.
I've been documenting the results of regular expressions in code blocks, so I've been pushing the highlighting by word feature. Overall, this works a treat, so thank you!
Three things I couldn't find but really wished I could do repeatedly. Maybe I missed them?
- Highlight an entire line words only without the
abc:xyz
method. - Easily start the word highlight without tabs or spaces at the start.
hl:1|:xyz
will always highlight from the start of a line (^
in RegEx) at the word level. - Specify the end of the line without specific letters/word combos. No way to grab multiple lines by using :s or :en, as it only goes as far as the first match.
Without these three options, I found I needed to specify many lines of filtering to get all of the nuances at the word level.
To improve this experience, I would propose hlw:
as an additional command that works exactly as hl does today but with these three key differences.
- All highlighting is interpreted as word only; it never highlights lines as a result.
hlw:1
would effectively be/^.*$/
for the 1st line in regex, for example. - If no value is provided to the left of a colon in
abc:xyz
eval,, it is interpreted as the first non-breaking space from the start of the string. - If no value is provided to the right of a colon in
abc:xyz
eval, it is interpreted as the end of the string (/$/).
Theoretically, this could also be applied to any custom alternative highlight colors by finding an extra w at the end of any custom defined names. i.e. If I added error and warn as alternative highlight colors, these rules above could be applied to those alternate highlight colors if use them as errorw:2,4-6 and warnw:2,4-6, respectively.