This appears to be an example of the XY problem. @b-layer has pointed out in the comments that there is likely to be limited success with individually highlighting listchars. I will address the issues with copy-pasting from vim in a terminal.
Option 1: continue using terminal-level copying. To avoid listchars getting into the copy, temporarily to
:set nolist to stop vim from displaying listchars. Then you can copy without any issue.
Option 2: use vim's system clipboard integration to copy directly from vim. See
:help clipboard for more information. Basically, if vim is compiled with clipboard support, the
+ registers can be used as the primary and clipboard x11 clipboards respectively. For example,
"+yy will copy the current line to the clipboard, and
"*p will paste the primary selection into vim.
To use the system clipboard by default instead of needing to use the
+ registers explicitly, use
:set clipboard=unnamed or
:set clipboard=unnamedplus. See
:help 'clipboard' for more.
EDIT: just thought of something (which i realize now is exactly what the answer you linked to was talking about). You can actually highlight these characters using a different method. Instead of relying on
list, you can add custom syntax matching and highlight groups. For example the following vimscript:
hi TabChar ctermbg=1
hi TrailingSpaceChar ctermbg=2
hi NBSP ctermbg=3
syn match TabChar " "
syn match TrailingSpaceChar " *$"
syn match NBSP " "
Will result in (solarized colour scheme):
Note: if copy/pasting this script, you will probably have to manually write in the tab and nbsp characters in the match regex because browsers like to convert them to spaces...