I have a function I wrote specifically for a certain session in vim. Manually redefining it every time I load the session is tedious. Is there any way custom functions can be saved with the session? If not, what're some options for speeding up reloading that function every time I load the session?
Assuming the functions are something you don't want all the time, so you don't want them in your
.vimrc file, you can define them in a separate file and use
:source filename to load in the definitions. This avoids the security issues of
set exrc and loading untrusted files.
If the pathname to your functions file is irritatingly long, you could even define a function in your
.vimrc just to call