Creating a Global Function in Fish shell

A brief overview of how to create a function in fish shell, and run from any location on your machine.

Image for post
Image for post
Fish Config Screenshot

Fish is a command line shell for Mac OS and Linux. It comes built in with various theme configurations, text-expanding abbreviations, and custom functions that can be run globally on your machine. This article will go over a quick way to set up a function.

Creating a Function:

Navigate to root

Create a simple function using the keyword

Save the function to the fish config file using

Thats it! To update your new function continue reading

Updating a function:

Navigate to the fish folder

Update the function using nano [exit using ctrl+x, y, ENTER] or vim [if you don’t want to exit at all]

Change the contents of your function :

Parameters & Arguments:

Anything passed after your function name can be accessed by using

Use functions at any location in the Fish Shell!

Written by

teacher | full stack web dev | software engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store