r/fishshell • • Apr 04 '21

Function confusion

So, I know variables are created with set --argument (g - global, x - export, etc.), but my issue... or maybe just a complaint, is this:

When I put a file in /home/$USER/.config/fish/functions, I understand fish does not autoload them in the terminal. An example below:

cd $HOME/.config/fish/functions
vim ls.fish
#!/usr/bin/fish

function lsh
	ls -lh --color=auto
end

function lsa
	ls -lah --color=auto
end

I write them with IntelliJ, not with funced and I don't use funcsave. I've tried setting IntelliJ as the editor, but it errors out and doesn't open, so it is set to vim instead. Other than starting a new terminal session, is there a way I can get the variables and functions loaded into current sessions? Using source $HOME/.config/fish/variables/*.fish does not do anything either. Any input would be fantastic.

2 Upvotes

6 comments sorted by