How to install and setup fish shell with default bash styles (minimal setup)

2 min read
How to install and setup fish shell with default bash styles (minimal setup)

Installing && Customizing The Fish Shell - step by step

FISH - the F/riendly I/nteractive S/H/ell

Is a smart and user-friendly command line shell for macOS, Linux, and the rest of the family. Fish includes features like syntax highlighting, autosuggest-as-you-type, and fancy tab completions that just work, with no configuration required.

Here is a list of some of the fish shell features:


Autosuggestion Thumbnail

fish suggests commands as you type based on history and completions, just like a web browser. Watch out, Netscape Navigator 4.0!

Glorious VGA Color

Colors Thumbnail

fish supports 24 bit true color, the state of the art in terminal technology. Behold the monospaced rainbow.

Sane Scripting

Scripting Thumbnail

fish is fully scriptable, and its syntax is simple, clean, and consistent. You'll never write esac again.

Web Based Configuration

Web Config Thumbnail

For those lucky few with a graphical computer, you can set your colors and view functions, variables, and history all from a web page.

Man Page Completions

Man Page Completions Thumbnail

Other shells support programmable completions, but only fish generates them automatically by parsing your installed man pages.

Works Out of the Box

Works Out of the Box Thumbnail

fish will delight you with features like tab completions and syntax highlighting that just work, with nothing new to learn or configure.

Installation && Configuration

# Update Repo's
$ sudo apt-get update
# Install Fish
$ sudo apt install fish
# Set Fish Shell as default
chsh -s $(which fish)
# Run Fish Shell
# Remove Greeting
set fish_greeting
# Install curl and git
$ sudo apt install curl
$ sudo apt install git
# Install powerline fonts
$ sudo apt install fonts-powerline
# show full path
$ set -U fish_prompt_pwd_dir_length 0

Setting up custom settings

# Setup custom prompt
sudo gedit ~/.config/fish/functions/


# for user (default bash theme):
function fish_prompt -d "Write out the prompt"    
	printf (set_color green --bold)'%s@%s'(set_color normal)':%s%s%s$ ' $USER $hostname \            
    (set_color blue --bold) (prompt_pwd) (set_color normal)          
# for root (clean):
function fish_prompt -d "Write out the prompt"    
	printf (set_color normal --bold)'%s@%s'(set_color normal)':%s%s%s# ' $USER $hostname \                
    (set_color normal --bold) (prompt_pwd) (set_color normal)        
# Create an alias (example)
alias aliasname "actualcommand"

🔁 Repeat again for every user you want to setup 🔁

Harduex blog