Using Fira Code Ligatures in RStudio

teaching
data science
A guide to my favorite font for data science
Author

Jeffrey Girard

Published

June 9, 2025

What are Ligature Fonts?

To quote the Fira Code README:

Problem

Programmers use a lot of symbols, often encoded with several characters. For the human brain, sequences like ->, <= or := are single logical tokens, even if they take two or three characters on the screen. Your eye spends a non-zero amount of energy to scan, parse and join multiple characters into a single logical one. Ideally, all programming languages should be designed with full-fledged Unicode symbols for operators, but that’s not the case yet.

Solution

Fira Code is a free monospaced font containing ligatures for common programming multi-character combinations. This is just a font rendering feature: underlying code remains ASCII-compatible. This helps to read and understand code faster. For some frequent sequences like .. or //, ligatures allow us to correct spacing.


Step 1: Install the Fira Code Font Family

Windows

  1. Go to https://github.com/tonsky/FiraCode/releases/latest
  2. Download the Fira_Code_vX.X.zip file
  3. Extract all the zipped files to a folder on your computer
  4. Open the extracted folder and open the ttf subfolder
  5. Highlight all files in the tff subfolder
  6. Right-click on one of these highlighted files to open the context menu
  7. Select “Install” from the context menu

Animation showing how to install the Fira Code font family on Windows

MacOS

  • Follow the same instructions 1(a) to 1(f) from Windows
  • Select “Open” or “Open with Font Book” from the context menu
  • Select “Install Font”

Linux


Step 2: Change the RStudio Editor Font

  1. In RStudio, open the “Tools” menu and select “Global Options…”

  2. Select the “Appearance” tab and change the “Editor Font” to Fira Code.

  3. Click the “OK” button.

Animation showing how to change the RStudio Editor Font to Fira Code

Step 3: Using Ligatures in RStudio

Now, certain character combinations will automatically be transformed into beautiful ligatures as you type them. The best part is that, although the ligatures may appear to be one character, they are still represented in your files as the individual characters and thus can still be edited without problem.

Animation showing the use of ligatures in RStudio

Here are some of my favorite Fira Code ligatures for R.

Assignment operators

x <- 10 becomes

23 -> y becomes

Relational operators

x <= y becomes

x >= y becomes

x == y becomes

x != y becomes

Native pipe operator

x |> sqrt() becomes