问题
I have added set listchars=tab:»\,trail:·,extends:#,nbsp:. for showing invisible characters.
It is working for tab extends but not working for nbsp, I have read the help for :set listchars and tried with examples given there, but still I am not getting dot character for single space character.
what else I have to do for this. Any suggestion.
Thanks
回答1:
Please be careful with the backslashes.
set listchars=tab:>\\,trail:·,extends:#,nbsp:.
This works as expected. However, one should note that nbsp stands for non-breakable space (character 0xA0). It's different from ordinary whitespaces (character 0x20) and in most cases, we'll have to do Ctrl-v x a 0 in insert mode to type it.
回答2:
More recent versions of vim can show regular spaces as well. (Confirmed on vim 7.4.1689).
:set list
:set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:»
来源:https://stackoverflow.com/questions/12814647/showing-single-space-invisible-character-in-vim