showing single space invisible character in vim

依然范特西╮ 提交于 2019-12-22 08:35:08

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!