# The Joy of Alacritty

I have been using iTerm2 for ages and would have continued had a recent update not broken ligatures for me. I am so glad it did, because it lead me to Alacritty.

## What

Alacritty does all the things I need and may even be faster than iTerm2. It is also a kick-butt Rust based project. What more could you ask for? If you say tabs, well then no, Alacritty does not support tabs. I use Tmux in place of tabs, so for me this just means that Alacritty is a better targeted solution.

I need a terminal emulator to be fast, support color, ligatures, Tmux, and VIM simultaneously and seamlessly. Alacritty does all this very well.

If I notice terminal introduced latency then it is too slow, if I do not, then it is fast enough. I use color to provide semantic clues. I expect at least 256 colors. Tmux and VIM should work together largely the way they work separately. Ligatures require more explanation.

A ligature is a single character representation of a symbolic concept resulting from the joining of two or more characters1. It is useful in some programming languages to simplify the display of compound ASCII symbols.

Here are two ways to represent not equal.

Not Equal - ASCII
Not Equal - Ligature

I use ligatures as a way to display symbols, comprised of multiple ASCII characters, as a simpler rendering, without altering the actual source characters. Here is an example from Fira Code that shows and example of the ASCII saved in a file, on the right, and the ligature representation displayed, on the left.

This enables me to view some characters as ligatures, but not to enforce my preference on other users of a source file. I like having the control of when to obscure the actual ASCII with ligatures. When I am editing a line, I like to see the original ASCII on that line so I can see what I am editing. The iTerm2 update forced the display of ligatures all the time. The iTerm2 configuration for this feature was disabled.

In order for me to control the expression of ligatures, I need the terminal emulator to display the actual character. I use tools like enomsg/vim-haskellConcealPlus to obscure the ASCII with ligatures when that is my preference.

Notice how some of the characters are displayed as ligatures even on the cursor line. The cursor is narrow in the in the screen-shot but look at the character just left of liftIO.

## How

Here is how I got Alacritty working on my Mac (Sierra 10.12.x). If you do not use Mac then your setup will be different.

### Fonts

I am using two fonts, Fira Code and Menlo. I beleive that Menlo ships with Mac, but Fira Code does not. Open Font Book to ensure both are installed. To install Fira Code, simply follow the instructions here. I just downloaded the Fira Code fonts and installed them with Font Book, rather than using homebrew. Once installed you should see the following in Font Book.

Fira Code
Menlo

### Tmux

Make sure Tmux is installed and reasonably updated. I found that the version from homebrew did not work fully, so I uninstalled it and installed the following from macports2.

• tmux @2.5_0
• tmux-pasteboard @2.6_0

I updated my ~/.tmux.conf to change the default terminal identifier.

### Alacritty

Manually install Alacritty as shown here, i.e. do not use homebrew.

Edit the .config/alacritty/alacritty.yml configuration file.

#### Update the fonts

I am using Fira Code for regular and bold fonts. I am using Menlo for Italic.

#### Misc

The terminal setting should look like.

Look over the rest of the config and ensure it matches your environment. I also changed the bash used to the version installed in /opt/local/bin.

The colors can be manually modified by providing the hex value.

If you are moving from another terminal emulator, like iTerm2 you can view the defined colors, for example from iTerm2ColorSchemes.com, and grab the hex value with Digital Color Meter.

Open Digital Color Meter and then menu, view, display values, and select as hexadecimal. Then fly over the color and then hit Shift - Command - c, to copy the hex value to the clipboard. Then from the clipboard, you can paste them to the .config/alacritty/alacritty.yml configuration file for the given color.

Also if you like the color schemes at iTerm2ColorSchemes.com you can find the scheme you like and read the termite config in github.

If for example you like the SoftServer scheme, you can view the hex values in github.com/mbadolato/iTerm2-Color-Schemes/blob/master/termite/SoftServer. The termite config file looks like this.

If manually editing is not your thing, there might be a color scheme that you can use. Nord Alacritty looks nice.

### Man

• Update ~.bashrc
• Create or edit ~/bin/.LESS_TERMCAP

### Enjoy

Here is are a few examples of the results.

#### Here is a Man page using color.

1. This is a simplified definition. See a better one here.

2. If I recall correctly the macports version has a patch of some kind.