Showing trailing spaces in vim

后端 未结 5 1615
生来不讨喜
生来不讨喜 2021-01-30 16:19

I\'ve set the following options in .vimrc

set listchars=tab:▸\\ ,trail:·
set list

And expected to see dots in those places where spaces are use

5条回答
  •  悲哀的现实
    2021-01-30 16:56

    And expected to see dots in those places where spaces are used for tabulation in the code (I use spaces, not tabs)

    Actually this is the other way round, tab option is used to display a character when a tab character is inserted (\t) instead of spaces. And trail is use to show trailing spaces at the end of lines.

    You seem to have single empty line with trailing spaces, and dots are correctly displayed.

    If you are only using spaces tab option is not used or displayed.

提交回复
热议问题