Using listchars to show leading whitespace in Vim

2019-03-16 17:49发布

问题:

This question already has an answer here:

  • Make Vim show ALL white spaces as a character 23 answers

I use spaces over tabs. In Sublime Text 2, I would have leading spaces show like so:

I have my .vimrc setup to show tabs, line endings, etc. But I'm not sure how to replicate what I have in Sublime. It was handy as I could still see indentation much more easily when just using spaces.

Here's my line for it now:

set listchars=eol:¬,tab:→→,extends:>,precedes:<

回答1:

The list+listchars combo can show trailing spaces but not leading spaces.

You could try vim-indent-guide.