[zsh] Add homebrew site-functions to fpath
This commit is contained in:
parent
21ebcac9d5
commit
f6774a6a13
3 changed files with 19 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env zsh
|
#!/usr/bin/env zsh
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
autoload -U compinit
|
autoload -Uz compinit
|
||||||
compinit
|
compinit
|
||||||
|
|
||||||
# Cache completions
|
# Cache completions
|
||||||
|
|
17
zsh/func/init_rc_fpath_darwin
Normal file
17
zsh/func/init_rc_fpath_darwin
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
|
autoload -Uz binary_exists
|
||||||
|
|
||||||
|
function init_rc_fpath_darwin
|
||||||
|
{
|
||||||
|
if binary_exists brew; then
|
||||||
|
local brew_fpath="$(brew --prefix)/share/zsh/site-functions"
|
||||||
|
if [[ -d "$brew_fpath" ]]; then
|
||||||
|
fpath+=($brew_fpath)
|
||||||
|
fi
|
||||||
|
|
||||||
|
export FPATH
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
init_rc_fpath_darwin "$@"
|
1
zshrc
1
zshrc
|
@ -1,6 +1,7 @@
|
||||||
# Eryn Wells <eryn@erynwells.me>
|
# Eryn Wells <eryn@erynwells.me>
|
||||||
|
|
||||||
zsh_init_rc_functions=( \
|
zsh_init_rc_functions=( \
|
||||||
|
init_rc_fpath_darwin \
|
||||||
init_rc_aliases \
|
init_rc_aliases \
|
||||||
init_configure_ls \
|
init_configure_ls \
|
||||||
init_rc_tilde_paths \
|
init_rc_tilde_paths \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue