@kennethormandy's answer is correct in it's way of describing how ligatures are made and how they work.
However, i wouldn't recommend using ToxicFrog/Ligaturizer to create ligatures if you do not understand how Ligaturizer work.
The principle behind Ligaturizer is to copy glyphs from FiraCode and to use said glyph where a certain string is positioned ; that's it.
Meaning that if you create a ligature to transform alpha
toward α
like this :
{
'chars': ['a', 'l', 'p', 'h', 'a'],
'firacode_ligature_name': 'alpha'
}
It would replace ALL occurrences of alpha
by α
:
alpha1
would become α1
.
alpha_test
would become α_test
.
- /!\
alphabet
would become αbet
. /!\
As what the original goal is to use those ligatures to replace variable names and not all occurrences, i would instead use another way instead of Ligaturizer.
Now place to my answer : I would instead recommend using lemegeton/glyphizer
As glyphizer was inspired by this exact post (and was henceforth made to answer all of the downside of using Ligaturizer for this exact problem) there's no need to go and change any configuration file as all the Greek letters are already inside those (or maybe just to remove useless ligatures).
The goal of glyphizer is to create a tool that allow the creation of simple ligatures (like Ligaturizer) but also contextual ligatures (must start with XXX, must end with YYY, must not start with AAA, must not end with BBB ; in our alpha
case it would be "must not start with [a-zA-Z]
and must not end with [a-zA-Z]
) while using the glyphs of the original font instead of the glyphs of FiraCode.
lambda
with "<space><space><space><space><lambda>λ", that is, the length of the word remains the same. – Aldred