1

A few months ago, someone in a programming class showed me a vim plugin he found that used Unicode to make source code "look pretty." I remember, specifically, that one of the things it did was make HTML comments (<!-- and -->) joined and look like one Unicode "thing." Note that this is just during rendering; the file itself still didn't have those Unicode chars.

An example of the sort of transformations it did would be how the code looks like on this demo page of a programming language that is not related to the question: https://blog.usejournal.com/introduction-to-clio-40dbbf9c250b

Specificlly: enter image description here

As you can see the -> is being rendered "as one character," as is the =>. (likely using conceal)

There is an Emacs plugin that does this, but I'm 80% sure I saw it was for vim.

I am aware of the implications and downsides to a plugin such as this, however, I would still like to know, what is this lost plugin? Where does it live, and how would I install it using plug?

  • Looks like ligatures. There are plenty of fonts supporting them but not sure if vim supports it (or is it terminal's job?) Anyway, there are neovim clients that support ligatures. – Maxim Kim Mar 20 at 19:22
  • Yes, I think ligatures sound right. (I've been looking for that word for 2 weeks now). Displaying ligatures onscreen would be the terminal's job (and that's another issue). What this plugin did, I believe, was "replace" the characters with this Unicode stuff. (similar to how 'elzr/vim.json' doesn't show the quotes, but it does when you are editing, and it saves with the quotes) – Lazerbeak12345 Mar 20 at 20:46
  • I did some research, and how they might have done it is a bunch of syntax conceals. – Lazerbeak12345 Mar 20 at 20:55
0

HAHA! I found it(?), after much research. (thanks to @Maxim Kim for reminding me that they are called ligatures)

So there are actually multiple that do this (makes sense to me).

Also, there are fonts that do it without the need of help from vim.

| improve this answer | |
  • Yeah, could be ligatures, could be conceal. Hard to tell, but those look more like ligatures since they maintain the spacing – D. Ben Knoble Mar 20 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.