Pretty Alacritty terminal with ZSH and Tmux

Contents

Here’s my config for a pretty Alacritty Tmux Zsh terminal :

zsh

First, install zsh and oh-my-zsh :

bash

sudo apt install zsh && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Then, clone the theme

bash

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k

Change the zsh theme in the ~/.zshrc :

bash

ZSH_THEME="powerlevel10k/powerlevel10k"

To configure the theme, run this command :

bash

p10k configure

You can configure the theme in the .p10k.zsh file.

Here’s my configuration on my Github

Here’s the two plugin that I use for auto suggestions and the syntax highlighting :

bash

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

git clone https://github.com/zsh-users/zsh-syntax-highlighting ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

git clone --depth 1 https://github.com/unixorn/fzf-zsh-plugin.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/fzf-zsh-plugin

And then, in the ~/.zshrc you have to specify them :

bash

plugins=(git command-not-found colored-man-pages colorize zsh-autosuggestions zsh-syntax-highlighting fzf)

HISTFILE=~/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory

Take a look at the CTRL + R! It replaces the history and CTRL + R :)

tmux

You have to install tmux :

Debian based :

bash

sudo apt install tmux

Arch based :

bash

sudo pacman -S tmux

Then clone the plugin manager for tmux :

bash

git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm

The config file should be placed in one of the following :

  • ~/.tmux.conf
  • ~/.config/tmux.conf
  • ~/.config/tmux/tmux.conf

Here’s my config; available on my Github

Install the fzf package and then the script :

bash

sudo apt install fzf

Download the script here and in the config, PREFIX + F look for ~/scripts/tmux-sessionizer. So put it in this directory or change the conf.

The main keybinds :

  • PREFIX is CTRL+Q (no caps needed)
  • Switch tabs : PREFIX + T
  • New tab is : PREFIX + C
  • Add right pane session : PREFIX + %
  • Add bottom pane session : PREFIX + "
  • Reload tmux conf : PREFIX + SHIFT + I
  • Mouse is not set
  • Kill window : PREFIX + & then press y
  • See tmux sessions : PREFIX + s
  • Good looking cd builtin : PREFIX + F and change the directory to the selected one
  • Rename session and window : PREFIX + : then rename-window <window name>

The icons comes from the Nerd Font FiraCode (in the next step)

If you have any trouble with the theme, go manually :

bash

mkdir -p ~/.config/tmux/plugins/catppuccin
git clone -b v2.1.2 https://github.com/catppuccin/tmux.git ~/.config/tmux/plugins/catppuccin/tmux

Then add this line to your tmux.conf :

bash

run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux

Then source your config file :

bash

tmux source ~/.tmux.conf

Alacritty

Install Alacritty :

bash

sudo apt install alacritty

Debian based :

bash

sudo apt-get -y install fonts-firacode

Arch based :

bash

sudo pacman -S nerd-fonts

Then select 28 for FiraCode. Free to you!

Then you can install it on Gnome with the Font app.

In the ~/.config/alacritty/alacritty.yml

bash

font:
  normal:
    family: "FiraCode Nerd Font Mono"
    style: Regular
  bold:
    family: "FiraCode Nerd Font Mono"
    style: Bold
  italic:
    family: "FiraCode Nerd Font Mono"
    style: Italic
  size: 12.0

Result