# Enabling font ligatures for GitHub Monaspace in Ghostty

post · 2024-12-28

import ThemeImage from '@components/ThemeImage.astro';

Like many others this week, I've been using [Ghostty][] as my terminal emulator. While reading the
[option reference][], I noticed that font ligatures should be enabled by default, however it didn't
seem to be the case with [GitHub's Monaspace] font:

[Ghostty]: https://ghostty.org/
[option reference]: https://ghostty.org/docs/config/reference
[GitHub's Monaspace]: https://monaspace.githubnext.com/

<ThemeImage src="/img/posts/enabling-font-ligatures/fizzbuzz-without-ligatures.png" alt="Fizzbuzz without ligatures" darkMode />

It turns out that the font splits ligatures into [different stylistic sets][1],
each set providing ligatures for specific languages.

[1]: https://monaspace.githubnext.com/#:~:text=feature-,code%20ligatures,-monaspace%20includes%20code

In my case, to have the ligatures most common in JavaScript, I enabled the `ss01` stylistic set and
a few others for other character sequences:

```ghostty
font-family = "Monaspace Neon Var"
# ss01: != and ===
font-feature = "ss01"
# ss02: <= and >=
font-feature = "ss02"
# ss03: -> and ~>
font-feature = "ss03"
# ss04: <> and </>
font-feature = "ss04"
# liga: //, ..., ||
font-feature = "liga"
```

I then reloaded the configuration with <kbd>⌘⇧,</kbd> and the ligatures were enabled:

<ThemeImage src="/img/posts/enabling-font-ligatures/fizzbuzz-with-ligatures.png" alt="Fizzbuzz with ligatures" darkMode />

It took me a few minutes to figure it out as I didn't know how code ligatures worked, so I hope
this helps someone in the future!
