4

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

leading spaces

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:<
Mateusz Piotrowski
  • 8,029
  • 10
  • 53
  • 79
agmcleod
  • 13,321
  • 13
  • 57
  • 96
  • 2
    This is essentially asking for the same thing as [this popular question](http://stackoverflow.com/q/1675688): it isn't possible. But there is [a patch pending](https://groups.google.com/d/msg/vim_dev/dIQHjW1g92s/FPUU_-9N3wYJ) on the devs mailing list: please make your voice heard there if you care for this feature being included in Vim. – glts Oct 07 '13 at 20:11
  • 4
    You can workaround this. In your case something like this should work: `syn match LeadingWS /\(^\s*\)\@<=\s/ conceal cchar=·`. You need a Vim with the `+conceal` feature and you need to enable it: `:setlocal conceallevel=2 concealcursor=nv` – Christian Brabandt Oct 08 '13 at 06:05

1 Answers1

8

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

You could try vim-indent-guide.

romainl
  • 186,200
  • 21
  • 280
  • 313
  • 2
    The indent guide isn't entirely what i was looking for, but it essentially solves the same problem. – agmcleod Oct 08 '13 at 12:59