Neovim 101 — Fonts

Configure delightful fonts for Neovim.

alpha2phi

--

Neovim 101 — Fonts

Learn the basics of configuring fonts for different terminals, and how to patch our own font.

This article is part of the Neovim 101 series.

The Neovim configuration files are available in this repository.

Getting Started

In this article, we will learn the basics of configuring fonts for different terminals. Specifically, we will use Alacrity, Kitty, and WezTerm as examples. We will also see how to patch our own font.

Nerd Fonts

Most of the fonts we are going to use will be from the Nerd Fonts repository. Depending on the OS, it provides different installation options.

The repository is big. To make it easy for installation, we would suggest

  • Use the option of release archive download. This makes it easy to install the complete font family of variations (Bold, Italic, etc.).
  • Use the getnf script.
getnf

Font Configuration

Depending on the OS, the fonts are installed in different locations. E.g. $HOME/.local/share/fonts for Linux, and $HOME/Library/Fonts for macOS.

Different OS provides different commands to check the installed fonts. E.g., for Arch Linux, we can use the fc-list command to get a list of installed fonts.

fc-list

We can see the locations, names, and styles of the installed fonts.

Terminal Fonts for Neovim

Every developer has their font preferences for coding. Let’s go through the basics of configuring terminal fonts.

Alacritty

For Alacritty, we configure the fonts in the $HOME/.config/alacritty/alacritty.yml file.

--

--

alpha2phi

Software engineer, Data Science and ML practitioner.