Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make vim show spaces?

Tags:

vim

I'm currently trying to switch from gedit to vim. I try to make vim look similar to gedit:

gedit

Especially, I would like to show spaces with dots.

I currently have:

enter image description here

There are some differences, but it looks quite similar (this is my current .vimrc file). But I don't get those dots for spaces.

How can I make vim show spaces?

I found some answers (like this one) that seem to suggest to replace spaces by a special visible character and then replace it back. I don't want to do this every time. I want to be able to open vim and see those spaces.

like image 650
Martin Thoma Avatar asked Apr 09 '13 14:04

Martin Thoma


People also ask

How do I use spaces instead of tabs in Vim?

To easily change a tab-based indent to use spaces instead when 'noexpandtab' is set, you can temporarily set 'expandtab' and use :retab with a range. For example, to convert only the current line to use spaces, use :. retab .

How do you highlight a space in Vim?

With the following, and the default backslash Leader key, you can type \wn to switch highlighting on, and \wf to switch it off. With Vim 7.1. 40 and later, you can use the matchadd() function to define matches (making the :match command available for other purposes).

How do I visualize a tab in Vim?

A quick way to visualize whether there is a Tab character is by searching for it using Vim's search-commands : In NORMAL mode, type /\t and hit <Enter> . It will search for the Tab character ( \t ) and highlight the results.

How do I view Crlf in vi?

vi shows newlines (LF character, code x0A ) by showing the subsequent text on the next line. Use the -b switch for binary mode. For example , vi -b filename or vim -b filename -- . It will then show CR characters ( x0D ), which are not normally used in Unix style files, as the characters ^M .


1 Answers

I know it's an old topic, but it's possible with:

set lcs+=space:· 

Works on my Gvim 7.4.

like image 184
Cedric Simon Avatar answered Oct 05 '22 23:10

Cedric Simon