Displaying all your tab characters in Vim

I usually use :set expandtab in Vim, but a particular file I was editing required explicit tab characters. So I set :noexpandtab, but then realized I couldn’t tell which were tabs, and which were spaces. Easy fix:

:set list
:set listchars=tab:\|\<Space>

…where <Space> is a literal space. Thanks again to the Vim Wiki!

Advertisements