Fish Shell Plugins You Need to Try for Optimal Shell Usage

Fish Shell Plugins You Need to Try for Optimal Shell Usage

Fish, or the Friendly Interactive Shell, is a powerful command-line interface shell that can highly enhance the way you interact with the terminal. Its user-friendly approach to shell scripting, syntax highlighting, and auto-suggestions makes it a solid alternative to more traditional shells like Bash or Zsh. But what about Fish plugins? Well, let’s take a closer look at some Fish shell plugins you don’t want to miss out on.

Command Not Found

The first plugin you want to have is Command Not Found. This plugin is all about making sure you don’t waste time typing in commands that don’t exist. When you enter a command that Fish doesn’t recognize, this plugin will automatically search for the package that contains such command and offers you the option to install it right on the spot.

With this plugin installed, Fire up your Fish shell and try running any command that doesn’t exist. You should see an interactive message that offers package installation, like the example below:

„`
$ nothere
fish: Unknown command ’nothere‘
Did you mean ’notes‘? (y/n) > y

Package ’notes‘ not found on system.
Either no package provides the command ’notes‘
or the package has been excluded from the system.
Install package ’notes‘, provided by ’note-utils‘ (y/n)? > y
„`

Z

Skip digging through your work directory trees to find that file you were working on yesterday. With Z, you can swiftly navigate to directories you frequent on the command line without having to remember the complete path. This Fish plugin adapts to the way you navigate and automatically learns your directory habits, so frequent folders automatically bubble up to the top of your directory list.

After installing the Z plugin, you can execute „z “ to quickly change directories:

„`bash
$ z fish
$ pwd

/home/user/fish
„`

Alias

The Alias plugin is super useful for creating your own command shortcuts. It lets you easily create frequently used commands by mapping them to shorter, more memorable words or phrases.

Here’s an example:

„`
$ alias v=“vim“
$ v
„`

This will launch Vim with a file named `v`.

ColorLS

Make your terminal command output look great with ColorLS. This plugin adds color and icons to the output of the `ls` command, making it easy to see which files are directories, executables, or images. ColorLS can also show the Git status of files, so you can see what’s been changed, added, or deleted right from the command line.

To try the ColorLS plugin:

„`
set -g fish_color_autosuggestion brblack
source (colorls fish integration.fish | ps_subst)
„`

Fish is a fascinating shell, and with these plugins, you can make it even more powerful. So give them a try and see how they improve your productivity on the shell.

And as always, happy Fish programming!