Setting up fish shell with the tide prompt

This is a cheat sheet for configuring fish shell with the tide prompt on Linux.


prerequisites.

A word of caution: If you happen to run Ubuntu, its version of fish can be quite outdated to the point that tide won’t work with it.
-Install/Update fish shell to the latest by adding the ppa

Bash
sudo add-apt-repository ppa:fish-shell/release-3
sudo apt update
sudo apt install fish
install/overwrite from ppa version

running fish
Bash
/usr/bin/fish
run the fish shell
Fish
chsh -s /usr/bin/fish
chsh “change shell” will change your default shell.

Install ‘fisher’

The fish shell has its own plugin manager called ‘fisher’.
We will need fisher to install the tide prompt plugin.

Fish (Most Distros)
curl -sL https://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish | source && fisher install jorgebucaran/fisher
Fish (Arch Linux)
sudo pacman -Sy fisher
Arch linux has fisher in its extra repo

install the tide prompt
Fish
fisher install IlanCosman/tide@v6
run the configuration script

tide has it’s own built-in configuration script that will get you most of the way there, most of the time:

Fish
tide configure

If you’re happy with the results, congrats, you’re done!




color customization

context

context” is the configuration name given to the part of the prompt that displays user@hostname. In a default tide config it is shown on the right-side prompt.

Fish
set -U tide_context_always_display true
Enables ‘context’ for local user sessions.
Fish
set -U tide_context_color_default white
sets the foreground color of ‘context’ for local user sessions
Fish
set -U tide_context_color_root CE2029
sets the foreground color of ‘context’ for local root sessions
Fish
set -U tide_context_color_ssh yellow
sets the foreground color of ‘context’ for ssh connections
Fish
set -U tide_context_bg_color black
sets the background color of ‘context’

pwd

pwd” stands for “print working directory” This is where we show the current working directory in the prompt. By default, it’s shown on the left-side.

We can change the background color of the pwd section by setting two universal environment variables:

Fish
set -U tide_pwd_bg_color yellow
(This sets the color of the outer “shapes”)
Fish
set -U tide_pwd_color yellow
(Yes, this actually sets the background color)

We can set the foreground colors of the parent directories with:

Fish
set -U tide_pwd_color_dirs 000000
(In this example I use a hex color instead)

We can set the foreground colors of the active working directory with:

Fish
set -U tide_pwd_color_anchors brwhite
Fish

With these settings you get something like /etc/systemd/system

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *