Last Updated: September 09, 2019
·
1.191K
· ascreamingweas

Switching to Fish

There are several options for customizing your shell. This is a walkthrough of installing and setting up the Fish shell to be used with iTerm2.

Fish offers some very helpful tools such as: syntax highlighting, autosuggestions, and tab completions. The color schemes are also helpful with presentation. You can read more about this here: http://fishshell.com/docs/current/tutorial.html#tut_why_fish.

Helpful syntax documentation for Fish can be found here: http://fishshell.com/docs/current/tutorial.html.


Installation

  1. Install Fish using brew: brew install fish. If you don't have brew installed yet, visit http://fishshell.com/ to download Fish. By default, Fish is installed under /usr/local/.
  2. Install Oh-my-fish from GitHub (https://github.com/bpinto/oh-my-fish#installation). Oh-my-fish is a framework for managing you fish-shell config. It includes optional plugins and themes (brew, git-flow, rails, python, node, etc). You can view all built-in plugins in: ~/.oh-my-fish/plugins/.
  3. The plugins and other settings are set in the fish config file located: ~/.config/fish/config.fish.

Set Up

  1. In addition, you will want to set Fish as your default shell by adding: /usr/local/bin/fish to your list of shells located in /etc/shells. You can manually start Fish by running: chsh -s /usr/local/bin/fish.
  2. In iTerm2, go to Preferences->Profile->General and select Command with the following path: /usr/local/bin/fish -l. This will start Fish when you open iTerm2 without needing to manually start it.

Customization

  1. You can edit some of the visual and functional configurations for your Fish shell by using it's built-in UI. Run the command: fish_config and you will be able to adjust the colors, prompt, functions, and variables.

Hints

Setting Environment Variables

set -x key value

2 Responses
Add your response

I've been using fish for a year now, and LOVE it.

One useful trick: set -xU key value

Then it's permanent across all fish shells present and future.

over 1 year ago ·

Is fish better than ZSH?

over 1 year ago ·