Pretty Alacritty terminal with ZSH and Tmux
Here’s my config for a pretty Alacritty Tmux Zsh terminal :
zsh
First, install zsh and oh-my-zsh :
sudo apt install zsh && sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Then, clone the theme
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
:
ZSH_THEME="powerlevel10k/powerlevel10k"
To configure the theme, run this command :
p10k configure
You can configure the theme in the .p10k.zsh
file.
Here’s my configuration on my Github
zsh plugins
Here’s the two plugin that I use for auto suggestions and the syntax highlighting :
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 :
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 :
sudo apt install tmux
Arch based :
sudo pacman -S tmux
Then clone the plugin manager for tmux :
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 :
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
isCTRL+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 pressy
- See tmux sessions :
PREFIX + s
- Good looking
cd
builtin :PREFIX + F
and change the directory to the selected one - Rename session and window :
PREFIX + :
thenrename-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 :
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
:
run ~/.config/tmux/plugins/catppuccin/tmux/catppuccin.tmux
Then source your config file :
tmux source ~/.tmux.conf
Alacritty
Install Alacritty :
sudo apt install alacritty
font!
Debian based :
sudo apt-get -y install fonts-firacode
Arch based :
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
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
