🍅 automatoes.com

Store Zsh Functions in a Directory

  1. Create a ~/.zfunc Directory
  2. In your .zshrc, add the following block to the top:
for file in ~/.zfunc/**; do
  autoload $file;
done
  1. Add a files containing zsh functions into your ~/.zshrc directory

For example, create a file named: lg

Add the contents:

ls | grep -i "$1"

Now you can search your current directory with:

lg foo

Tags:

Contributor: [John Lindquist]

Referred in

edit
Store Zsh Functions in a Directory