Setting up a modern console-based IDE (Alacritty, TMUX & OhMyZsh)

Robertoplazaromero
3 min readMar 31, 2021

Hey kid, do you want your text editor to be closed with “:wq”? I want it, but in order to make VIM truly shine I needed to setup a whole new ecosystem. My working distro is Ubuntu 20.04, but commands showed should be valid for any Debian-based distribution.

The journey to the perfect CLI setup begins with a complain for gnome-shell. With my current configuration, the top border is just too thick. Color customization, on the other hand goes from decent to quite good. Despite Guake looking like a good alternative, I ended up using Alacritty. Alacrity is just everything I need, open-source, opengl-based rust terminal emulator. (It even runs on windows! Awesome news for WSL developers)

Easiest wat to install Alacritty is by adding the unofficial repository. This one provide you with the latest release, but is incredibly convenient:

# add-apt-repository ppa:aslatter/ppa
# apt install alacritty

For latest releases check out the public repo: https://github.com/alacritty/alacritty/releases

After instalation and once Alcritty is in a directory in PATH, you can set it as the default terminal for your machine :

# update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/alacritty 100
# update-alternatives --config x-terminal-emulator

Feel free to change ‘/usr/bin/alacritty’ for the path to the executable of Alacritty in your system. From now on, Alacritty should pop up everytime you press ctrl+alt+T.

You’ll need TMUX if you want to multiplex your terminals and you’ll probably want to use Zsh also. In order to set up both of them you should set TMUX as the default shell of Linux and Zsh as the default shell of TMUX.

# apt install zsh tmux
$ echo "set-option -g default-shell /usr/bin/zsh" > ~/.tmux.conf
$ tmux -f ~/.tmux.conf

The only thing that’s left is to setup tmux as the default shell for Alacritty. This shouldn’t be necessary, but you can extend the configuration once the file is created.

cat << EOF >> ~/.config/alacritty/alacritty.yml
shell:
program: /usr/bin/tmux
startup_mode: Fullscreen
EOF

Please, note that the location “~/.config/alacritty/alacritty.yml” is just one of many, visit the section “Configuration” in https://github.com/alacritty/alacritty for more details.

Et c’est voila! TMUX, Zsh and Alacritty should be configured without conflits by now.

Extra: Set TMUX command to C-space

TMUX default configuration is not as good as comfortable as it could be. It works a bit like VI, but in order to enter command mode you’ll need to type Control+b. Rebinding this to Control+space will make you about a gazillion times faster. Simply add the new lines to the config file and reload the configuration:

cat << EOF >> ~/.tmux.conf
set -g prefix C-space
unbind-key C-b
bind-key C-space send-prefix
EOF
# Bindings, not code
C-b :source-file ~/.tmux.conf

Extra: OhMyZsh & Fish autosuggestion

I’m not quite sure about how to define OhMyZsh, but I mainly use it as a way to extend Zsh functionality. Start by installing OhMyZsh:

sh -c “$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Some interactive configuration will pop up. After that simply download the autosuggestion repository and allow the plugin to be installed:

git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
echo "plugins=(zsh-autosuggestions)" >> ~/.zsh

This is (mostly) everything I need to be productive, but it’s easily extendable, from here, the world is your’s.

--

--