I'm currently trying to switch from gedit to vim. I try to make vim look similar to gedit:
Especially, I would like to show spaces with dots.
I currently have:
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.
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 .
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).
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.
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 .
I know it's an old topic, but it's possible with:
set lcs+=space:·
Works on my Gvim 7.4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With