Displaying tabs as characters
When I work on files in python, I sometimes mistake tabs for spaces and vice versa. Is there a way I can get Vim to display a character for a tab instead of a tab?
Just as a side note, you can configure to convert all tabs to spaces with `retab` every time you save the file.
Yes, use listchars:
set list set listchars=tab:>-
If you put these two lines in your .vimrc, tabs will be shown as
>for the start position and
-through the rest of the tab.
(Sidenote: listchars can also show trailing spaces with
xwith the character you want to use for a trailing space), which can be useful as well.)
Note: I like to use `set listchars=tab:!·,trail:·`, IMHO `·` is a lot clearer than a `-` ... You need a fairly recent Vim version for this to work btw (not sure which exactly, I think 7.3.x)...
I like using the unicode character `▸` as it is slightly smaller than `>`. Currently I see trailing white space by marking the eol (though I may try the above). My settings are: `set listchars=eol:¬,tab:▸\ ` and