1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-15 12:19:49 +00:00

rename oh-my-zsh entry

This commit is contained in:
skywind3000
2019-02-02 11:40:30 +08:00
parent b013719a83
commit 8f8efb9d31

31
z.lua.plugin.zsh Normal file
View File

@@ -0,0 +1,31 @@
#! /usr/bin/env zsh
ZLUA_SCRIPT="${0:A:h}/z.lua"
[[ -n "$ZLUA_EXEC" ]] && [[ ! -x "$ZLUA_EXEC" ]] && ZLUA_EXEC=""
# search lua executable
if [[ -z "$ZLUA_EXEC" ]]; then
if [[ -x "$(which lua)" ]]; then
ZLUA_EXEC="$(which lua)"
elif [[ -x "$(which lua5.3)" ]]; then
ZLUA_EXEC="$(which lua5.3)"
elif [[ -x "$(which lua5.2)" ]]; then
ZLUA_EXEC="$(which lua5.2)"
elif [[ -x "$(which lua5.1)" ]]; then
ZLUA_EXEC="$(which lua5.1)"
else
echo "Not find lua in your $PATH, please install it."
return
fi
fi
eval "$($ZLUA_EXEC $ZLUA_SCRIPT --init zsh once enhanced)"
alias zz='z -i'
alias zc='z -c'
alias zf='cd "$(z -l -s | fzf --reverse --height 35%)"'
alias zzc='zz -c'