Why Fish
Good question. I was using ZSH for a while, when I needed to set up a new laptop. Having heard good things about Fish, on a whim, it was chosen. It is still in use because there are some things it does well, though most can be done—potentially with more work—in other shells. The main down-side is being less common than ZSH, which is less common than Bash.
Installation
The easiest installation is via Homebrew. Below are the main commands that can be used to set up the shell
brew install fish
brew install fzf
brew install starship
echo "starship init fish | source" >> ~/.config/fish/config.fish
curl -L https://get.oh-my.fish | fish
Note: Installing via Curl like that is potentially risky. Please check the URLs and scripts to make sure you are good with what they are doing.
The steps above install three other useful bits. The first is fzf
, which
sets up fuzzy searching for command completion.
Next is Starship for shell prompt customization. It technically works with any shell, and is fairly commonly used.
And finally, it installs Oh My Fish, a package manager that allows other functions, command completions, and themes to be easily installed and managed.
Note: I used to also use fisher, but an attempt to update it broke it and a few of its plugins. Based on just how opinionated it is and how those opinions have caused and/or will cause breaking changes, sticking with OMF seemed good enough and less likely to cause issues.
Oh My Fish Packages
According to omf list
, the following packages (what OMF calls its plugins and
themes) are currently installed:
- asdf: Installs the asdf virtual environment manager.
- omf: Oh My Fish itself.
- aws: Completions and integration for the AWS CLI.
- colored-man-pages: Exactly what it says. Makes man pages a bit easier to read.
- homebrew-command-not-found: Suggests a Homebrew install when a command does not exist, but brew has a likely match.
- pj: A “project jump” command.
Tell it the paths to your projects’ parent directories with:
set -gx PROJECT_PATHS <directory> []... <directory>]
. Thenpj <project-dir>
will take you there. It even has tab-completion to prevent typos. - bobthefish: The Powerline-like theme currently in use.
Note: OMF does not have a command to list available packages, though that would be nice. Instead, There is a list in the Github repository.
Useful OMF Commands
omf install <package-name>
- Install a package.omf update
- Updates the core and all installed packages.omf update [<package-name>]
- Update a specific package.omf search
- Search for a package or theme.omf list
- List installed packages. (Lists OMF itself.)