You can achieve an effect similar to this by changing the colour of tabs so you can't see them, and then making them visible again when
they are at the end of a line.
In the colorscheme I'm currently using, the background is set to colour
will need to tweak the colours in the first
highlight command to match those in your colorscheme (and add
gui options to
the highlight commands if you're working in GUI Vim).
" First, turn on list
" Now change the colours so that tabs blend in with the background
highlight SpecialKey ctermfg=8 ctermbg=8
" Now add a highlight group for tabs we do want to be visible.
" The command below is likely to work in all colorschemes, but feel free to
" edit to your taste.
highlight link VisibleTab Error
" Set up a match to use the new highlight for tabs at the end of the line
match VisibleTab /\t$/
You can also use the same technique for some of the other invisible characters mentioned in
:help 'listchars' by changing the regular expression in the