.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "FUNCSAVE" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME funcsave \- save the definition of a function to the user's autoload directory .SH SYNOPSIS .nf \fBfuncsave\fP \fIFUNCTION_NAME\fP \fBfuncsave\fP [\fB\-q\fP | \fB\-\-quiet\fP] [(\fB\-d\fP | \fB\-\-directory\fP) \fIDIR\fP] \fIFUNCTION_NAME\fP .fi .sp .SH DESCRIPTION .sp \fBfuncsave\fP saves a function to a file in the fish configuration directory. This function will be \fI\%automatically loaded\fP by current and future fish sessions. This can be useful to commit functions created interactively for permanent use. .sp If you have erased a function using \fI\%functions\fP\(aqs \fB\-\-erase\fP option, \fBfuncsave\fP will remove the saved function definition. .sp Because fish loads functions on\-demand, saved functions cannot serve as \fI\%event handlers\fP until they are run or otherwise sourced. To activate an event handler for every new shell, add the function to the \fI\%configuration file\fP instead of using \fBfuncsave\fP\&. .sp This is often used after \fI\%funced\fP, which opens the function in \fB$EDITOR\fP or \fB$VISUAL\fP and loads it into the current session afterwards. .sp To view a function\(aqs current definition, use \fI\%functions\fP or \fI\%type\fP\&. .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .