user1087001
user1087001

Reputation:

Display character differently in Vim via Vimrc

Currently in my vimrc I have the following line:

au BufWinEnter * call matchadd('SpecialKey', '[         ⁠     ]')

Between the brackets are various Unicode space characters. This highlights Unicode spaces so that I can tell them apart from normal ones (I have a few documents that I use em-spaces in quite heavily).

However, I was wondering if there is some way to display a character as another character in Vim? This way I could display wide spaces as two normal space characters, for instance, but when writing out the file the appropriate Unicode space character would be written. I know this is possible for tabs and whitespace errors with list and listchars, but I'd like a way to display any character as any other character (or string).

Upvotes: 1

Views: 220

Answers (1)

romainl
romainl

Reputation: 196886

You are looking for the conceal feature.

See :help conceal.

Upvotes: 1

Related Questions