Highlight unwanted whitespace across you project files. The fun part is that you can come up with your own palette of colors used for a specific pattern per a filetype!
Почитать на русском :ru:
Go to the Current Colorscheme section
to see what each color stands for.
(Unfortunately placing it here breaks syntax
highlighting for all multi-line code blocks below it)
With lazy.nvim
{
"lukoshkin/highlight-whitespace",
config=true,
}
With packer.nvim
use "lukoshkin/highlight-whitespace"
tws
keyword - "main" pattern for trailing whitespace highlighting
clear_on_bufleave
- boolean opt to clear highlighting in the current buffer
before switching to another
Ignoring specific filetypes is possible by setting an empty table next to a
filetype in the palette
.
To highlight only python and markdown filetypes
palette = {
python = {
-- some patterns
},
markdown = {
-- some patterns
},
other = {},
}
To ignore highlighting only in javascript
palette = {
javascript = {},
other = {
-- some patterns
},
}
This section refers to the GIF at the README beginning
$$ {\color{PaleVioletRed}red}\text{ color ─ trailing whitespace in Python (other than md)} $$
$$ {\color{#3B3B3B}dark\ gray}\text{ ─ leading and trailing whitespace in comment sections} $$
$${\color{RosyBrown}brown}\text{ ─ in markdown}$$
$$ {\color{#CDBE70}yellow}\text{ color ─ redundant (multiple) spaces in Python} $$
$${\color{#87CEFF}blue}\text{ ─ in markdown}$$
$${\color{#FF7256}orange}\text{ color ─ a space before a comma in Python}$$
$${\color{#7AC5CD}"green"}\text{ ─ in markdown}$$
$${\color{#8B668B}purple}\text{ color ─ tab indents instead of spaces}$$