I want to configure vim to be able to display certain character ⇒
as something else =>
.
Obviously the first character is a non-ascii character, while the second one is actually two characters.
I was looking into something similar to listchars
but with more flexibility as I can specify the character as well as the conversion.
I only want to do this for visualization purpose, i.e. I don't want to edit the actual file.
Alternatively I was thinking of editing the font itself to display this character differently and then use this "modified" version of the font inside MacVim only. but it seems to be very complicated and never works with fontforge.
Is there's anything similar in vim/macVim?
The conceal feature allows to display a [sequence of] character[s] as a different single character. This could be used to display =>
as ⇒
, but unfortunately, not the other way around.
Likewise, modifying the font won't work; each character occupies exactly one display cell (well, except for double-width characters, but you can't just turn a single-width into a double-width one).
I'm not sure what your motivation is, but just imagine how confusing editing would become if you could address the single ⇒
(even in widened form) as two characters (but editing commands like f
or :s
would still see the single character).
The only way to achieve something similar is to do a :%substitute/⇒/=>/g
when editing the buffer, and undoing that for :write
(using :autocmd
s), but I would recommend against it.