/

The Fish Shell: An Introduction to the Best Shell for Developers

The Fish Shell: An Introduction to the Best Shell for Developers

I have been using the Fish Shell for months now, and I can confidently say that it is the best shell I have ever used. While many people stick with Bash or use Zsh with tools like Oh My Zsh, Fish Shell offers a more powerful and customizable option right out of the box.

Bash is a basic shell with limited configuration options, making it more suitable for running Bash scripts rather than as an interactive shell. Zsh, on the other hand, offers a wide range of features but requires more configuration, which can be intimidating for beginners. Moreover, having too many options can often lead to configuration paralysis.

Enter Fish Shell! This shell provides an amazing environment with fully featured configuration right from the start. Some of my favorite features of Fish include:

  • Better autocomplete for previously executed commands, making my day-to-day tasks faster and less stressful.
  • The ability to quickly see the past usage of a command by hitting the up key while typing the command.
  • Easy installation on any system without the need for extensive customization.

Fish Shell also offers syntax highlighting, a nice prompt, autocompletion, parameter suggestion with man page hints, and a web-based configuration, making it the most beginner-friendly shell I have come across.

One interesting thing I noticed about Fish Shell is its homepage, which humorously states that, for those lucky enough to have a graphical computer, they can configure their shell settings using a web page. It reminded me that tech should always be fun.

Let’s start with the basics: what exactly is a shell?

A shell is an interface to the underlying operating system that allows you to execute operations using text and commands. It provides advanced features like script creation.

To install Fish, simply run brew install fish on macOS. Fish will be installed in /usr/local/bin/fish. You can start the Fish Shell by running fish, and to return to your default shell, type exit.

One great aspect of Fish Shell is its web-based configuration. Running fish_config will open the web client, where you can choose a color scheme and prompt from a list of options, inspect configured functions and variables, and view command history. The configuration is stored in the ~/.config/fish folder, which you can edit directly if you prefer.

Fish Shell enhances the Unix command execution experience with built-in features like syntax highlighting, autocompletion, and parameter suggestion with man page hints. For example, as you type a command, Fish Shell highlights different parts of the command, making it easier to read and understand. It also suggests commands based on your command history and file paths, which can be quickly accepted by pressing the right arrow key. Additionally, when typing a command with parameters, Fish Shell displays a list of available parameters and their meanings by pressing the tab key.

To set Fish Shell as your default shell, open the file /etc/shells and add the line /usr/local/bin/fish at the end. Then, run chsh -s /usr/local/bin/fish and enter your password to make the change.

Fish Shell supports plugins, and a popular package manager for Fish is Fisher. Install Fisher by running curl https://git.io/fisher --create-dirs -sLo ~/.config/fish/functions/fisher.fish, and then you can install and manage packages using the fisher add <github-repository-path> and fisher rm <github-repository-path> commands. To see all installed plugins, use fisher ls, and to update all installed packages, run fisher.

While various shells comply with the POSIX standard, Fish Shell is not POSIX compliant. This means that scripts written specifically for Fish Shell will not work in other POSIX-compliant shells. Although this is rarely a problem for executing commands, it is essential to keep in mind when writing scripts and programming.

In conclusion, Fish Shell is the ultimate shell for developers, offering powerful features, easy configuration, and a user-friendly interface. Give it a try, and I guarantee you’ll never look back.

tags: [“Fish Shell”, “shell”, “commandline”, “scripting”, “developers”]