FUNCSAVE(1) fish-shell FUNCSAVE(1)

# [NAME](#NAME)

funcsave - save the definition of a function to the user's autoload directory

# [SYNOPSIS](#SYNOPSIS)

```
funcsave FUNCTION_NAME
funcsave [-q | --quiet] [(-d | --directory) DIR] FUNCTION_NAME
```

# [DESCRIPTION](#DESCRIPTION)

**funcsave** saves a function to a file in the fish configuration directory. This function will be automatically loaded &lt;#syntax-function-autoloading&gt; by current and future fish sessions. This can be useful to commit functions created interactively for permanent use.

If you have erased a function using functions &lt;&gt;'s **--erase** option, **funcsave** will remove the saved function definition.

Because fish loads functions on-demand, saved functions cannot serve as event handlers &lt;#event&gt; until they are run or otherwise sourced. To activate an event handler for every new shell, add the function to the configuration file &lt;#configuration&gt; instead of using **funcsave**.

This is often used after funced &lt;&gt;, which opens the function in **$EDITOR** or **$VISUAL** and loads it into the current session afterwards.

To view a function's current definition, use functions &lt;&gt; or type &lt;&gt;.

# [Copyright](#Copyright)

fish-shell developers

September 9, 2026 4.9

---

Document: funcsave(1) from fish 4.9.3-r0 (Chainguard OS)
Source: https://github.com/fish-shell/fish-shell
