mirror of
https://github.com/notwa/rc
synced 2025-02-05 15:43:22 -08:00
automatically initialize fasd
This commit is contained in:
parent
03f4ae25fc
commit
213b2a55f0
1 changed files with 21 additions and 2 deletions
23
home/zshrc
23
home/zshrc
|
@ -1,11 +1,16 @@
|
||||||
setopt extended_glob
|
setopt extended_glob
|
||||||
|
|
||||||
|
local host="${(L)HOST}"
|
||||||
fpath=(~/sh $fpath)
|
fpath=(~/sh $fpath)
|
||||||
|
|
||||||
function {
|
function {
|
||||||
local f
|
local f
|
||||||
for f in ~/sh/^([_.]*)(N^/:t); do
|
for f in ~/sh/^([_.]*)(N^/:t); do
|
||||||
autoload -Uz $f
|
if [[ "$f" == fasd ]]; then
|
||||||
|
emulate sh -c "autoload -U $f"
|
||||||
|
else
|
||||||
|
autoload -Uz $f
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
zsc() {
|
zsc() {
|
||||||
|
@ -154,7 +159,6 @@ fi
|
||||||
# note: zsh adds a % symbol to newline-less output, so bash prompt is overkill
|
# note: zsh adds a % symbol to newline-less output, so bash prompt is overkill
|
||||||
function {
|
function {
|
||||||
local good='green'
|
local good='green'
|
||||||
local host="${(L)HOST}"
|
|
||||||
[[ "$host" == "neobanshee" ]] && good='cyan'
|
[[ "$host" == "neobanshee" ]] && good='cyan'
|
||||||
[[ "$host" == "spectre" ]] && good='white'
|
[[ "$host" == "spectre" ]] && good='white'
|
||||||
[[ "$host" == "wraith" ]] && good='yellow'
|
[[ "$host" == "wraith" ]] && good='yellow'
|
||||||
|
@ -184,3 +188,18 @@ function {
|
||||||
ADDPATH $gm
|
ADDPATH $gm
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if [[ "$host" == "spectre" ]] || [[ "$host" == *"banshee" ]]; then
|
||||||
|
# via https://github.com/whjvenyl/fasd
|
||||||
|
if [ ! -s "$HOME/.fasd_init" ]; then
|
||||||
|
# note that posix-alias defines aliases for the following:
|
||||||
|
# a s d f sd sf z zz
|
||||||
|
fasd --init \
|
||||||
|
posix-alias \
|
||||||
|
zsh-hook zsh-ccomp zsh-ccomp-install \
|
||||||
|
zsh-wcomp zsh-wcomp-install \
|
||||||
|
>| "$HOME/.fasd_init"
|
||||||
|
fi
|
||||||
|
source "$HOME/.fasd_init"
|
||||||
|
alias v="f -e $EDITOR"
|
||||||
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue