L
L
lovesuper2014-07-23 15:52:22
linux
lovesuper, 2014-07-23 15:52:22

How to display spaces in VIM (ALL spaces, not just trailing)?

set list
set listchars=eol:↲,tab:→→,trail:•,nbsp:↔

here's the part of the .vimrc I'm using.. everything I listed works, but what key do I need to run to show all spaces in the file at all?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
L
lovesuper, 2015-12-29
@lovesuper

All you need is:

set listchars=eol:¬,tab:> ,trail:~,extends:>,precedes:<,space:•
set list

(in .vimrc)

E
EXL, 2014-07-23
@EXL

I also faced the same problem, and did not find a sane solution. I'm very used to how Qt Creator renders spaces and tabs.
So you can immediately find problems with code formatting.
Subscribe to the question, if you find a solution outside of this resource, please let me know (contacts in the profile).

S
Sergey Krasnodemsky, 2014-07-24
@Prognosticator

listchars does not work with spaces
, but there is a way out :) you can convert spaces to tabs

:set noexpandtab
:retab!
:set listchars=tab:.\ ,extends:>,precedes:<,trail:.,nbsp:.

it’s not clear why I can’t attach the screenshot - but @EXL
once used the plugin , maybe it will suit you

A
Alex, 2014-12-08
@DrLivesey

You can usematchadd()

:highligh Spaces ctermbg=Yellow guibg=Yellow
:call matchadd('Spaces', '\s\+')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question