fish

fish

fish - the friendly interactive shell

https://fishshell.com

Setup

Install

brew install fish

Add to shells

echo "$(brew --prefix)/bin/fish" | sudo tee -a /etc/shells

(Optional) Make fish your default shell

chsh -s "$(brew --prefix)/bin/fish"

Basic setup

Homebrew

Create a file under ~/.config/fish/conf.d called __brew.fish (or similar). We just want to make sure, this is loaded as the very first config file.

eval "$(/opt/homebrew/bin/brew shellenv)" # instead of /opt/homebrew, might be /usr/local

# Optional shortcuts
abbr bubo "brew update && brew outdated"
abbr bubc "brew upgrade && brew cleanup"
abbr bubu "brew update && brew outdated && brew upgrade && brew cleanup"

VS Code

Add this to your settings.json:

{
 ...
  "terminal.integrated.profiles.osx": {
    "fish": {
      "path": "fish",
      "args": ["-l"]
    }
  },
  ...
}

Oh My Fish

Oh My Fish

The Fishshell Framework

Install

Check out the Oh My Fish GitHub page. Currently, the installer is:

curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | fish

Usage

omf install [<name>|<url>|<user/repo>]
omf update [omf] [<package>...]
omf list
omf remove <name>

… and more at the Oh My Fish GitHub page

Uninstall

omf destroy

Packages

  • fish_logo – Command to print the fish logo
  • rbenv – Automatic rbenv configuration

… more packages can be found at Oh My Fish’s packages main repo

themes

You can use Oh My Fish to set your fish theme

omf theme <theme>

(after omf install <theme>) Checkout themes here

Starship

Starship

Install

brew install Starship

Setup

in ~/.config/fish/config.fish, add:

starship init fish | source

Usage

Put your configuration in ~/.config/starship.toml.

Use the explain command to get information why what is currently displayed.

starship explain

(Optional) Install and enable a Nerd font

Select your favorite Nerd Font at nerdfonts.com

or install them with Homebrew, e.g.

brew install font-jetbrains-mono-nerd-font
brew install font-fira-code-nerd-font

Enable the font in your terminal app or in VSCode as

{
  "editor.fontFamily": "JetBrainsMono Nerd Font"
}

Starship examples

format = """
[┌$fill]()
([│]()$all)\
[│]()$directory
[└]()$character"""

right_format = "$cmd_duration ▶▶$time"

[fill]
symbol = "─"
style = "bold"

[time]
disabled = false
format = "[$time]($style)"
style = "bold red"

# Add the count of files to git_status
[git_status]
format = '([$ahead_behind$all_status]($style) )'
conflicted = "=${count}"
ahead = "⇡${count}"
behind = "[⇣${count}](green)"
diverged = "⇕⇡${ahead_count}⇣${behind_count}"
up_to_date = ""
untracked = "?${count}"
stashed = "[*${count}](green)"
modified = "[!${count}](#ffa500)"
staged = "[+${count}](#ffd700)"
renamed = "»${count}"
deleted = "✘${count}"


# Customs
[custom.flutter]
command = "cat $HOME/development/flutter/version" ## This is very slow
detect_files = ["pubspec.yaml"]
format = "via [Flutter $output](flutter_skyblue)"