Moving on to Fish shell (and beyond)

Note
This article was last updated on 2023-07-21, the content may be out of date.

While chatting with one of my WL colleague, I stumbled upon Fish shell. I immediately liked its autocompletion and extensibility mechanisms. After many years using BASH and ZSH, I therefore decided to move on to this new shell.

Unlike the others, it’s not POSIX-compatible.

Furthermore, to get (at least) the same functionalities as OhMyZsh, I chose to install StarShip.

I will then describe how I moved on and updated my existing tools such as SdkMan.

OS
I applied these commands on both Ubuntu20/WSL2 and Linux Mint.

To install it, run this command:

jshelllanguage

sudo apt install fish

You must also use a font available on the NerdFonts website. By the way, you can also use the fonts available through your package manager.

For instance, I chose using JetBrains Mono

After downloading it, you can reload your font cache running this command:

jshelllanguage

fc-cache -fv

I ran this command:

jshelllanguage

curl -sS https://starship.rs/install.sh | sh
How to update StarShip
To update StarShip, you must use the same command.

I also added the following command at the end of ~/.config/fish/config.fish:

shell

starship init fish | source

Due to some WSL2 incompatibilities, I also chose to use the plain text presets running this command:

jshelllanguage

starship preset plain-text-symbols -o ~/.config/starship.toml

At this stage, SdkMan didn’t work at all. To put it alive again, I had to install Fisher and a SdkMan for fish plugin.

Run this command:

jshelllanguage

curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher

Run this command:

jshelllanguage

fisher install reitzig/sdkman-for-fish@v2.0.0

Run this command:

jshelllanguage

sdk ug

Say yes and restart a shell. Now it should work.

I had the same issue with NVM.

I then installed another plugin with Fisher:

jshelllanguage

fisher install jorgebucaran/nvm.fish

I use GnuPG for signing my GIT commits. Installing Fisher broke my setup.

I then added this new configuration file $HOME/.config/fish/conf.d/config_gpgagent.fish with the following content:

jshelllanguage

set -gx GPG_TTY /dev/pts/0

To activate it, restart your shell (again).

I can now use FISH for my daily job. As I said first, this article is only a reminder for my next setups (aka when I will broke my GNU/Linux boxes and try to restore them).

Hope it will help you!