From 336e95b05aeba1d6033e68d9eeaf24353f700654 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= Date: Sat, 13 Nov 2021 10:32:59 +0100 Subject: [PATCH 1/3] Try luajit in zsh and fish --- init.fish | 2 ++ z.lua.plugin.zsh | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/init.fish b/init.fish index 788054b..cb2f5ad 100644 --- a/init.fish +++ b/init.fish @@ -27,6 +27,8 @@ end if test -e $_zlua_dir/z.lua if type -q lua lua $_zlua_dir/z.lua --init fish enhanced once echo | source + else if type -q luajit + luajit $_zlua_dir/z.lua --init fish enhanced once echo | source else if type -q lua5.3 lua5.3 $_zlua_dir/z.lua --init fish enhanced once echo | source else if type -q lua5.2 diff --git a/z.lua.plugin.zsh b/z.lua.plugin.zsh index b929459..4383419 100644 --- a/z.lua.plugin.zsh +++ b/z.lua.plugin.zsh @@ -6,7 +6,7 @@ ZLUA_SCRIPT="${0:A:h}/z.lua" # search lua executable if [[ -z "$ZLUA_EXEC" ]]; then - for lua in lua lua5.3 lua5.2 lua5.1; do + for lua in lua luajit lua5.3 lua5.2 lua5.1; do ZLUA_EXEC="$(command -v "$lua")" [[ -n "$ZLUA_EXEC" ]] && break done From c88746629be0e8d330bd51a59253a8c037215a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= Date: Sat, 13 Nov 2021 10:33:41 +0100 Subject: [PATCH 2/3] zsh plugin: fix ZLUA_EXEC check Previous check required full path (even if value was available in PATH) --- z.lua.plugin.zsh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/z.lua.plugin.zsh b/z.lua.plugin.zsh index 4383419..971fa72 100644 --- a/z.lua.plugin.zsh +++ b/z.lua.plugin.zsh @@ -2,7 +2,10 @@ ZLUA_SCRIPT="${0:A:h}/z.lua" -[[ -n "$ZLUA_EXEC" ]] && [[ ! -x "$ZLUA_EXEC" ]] && ZLUA_EXEC="" +if [[ -n "$ZLUA_EXEC" ]] && ! which "$ZLUA_EXEC" &>/dev/null; then + echo "$ZLUA_EXEC not found" + ZLUA_EXEC="" +fi # search lua executable if [[ -z "$ZLUA_EXEC" ]]; then From 99dbe7b677585bd0b5f5a0d2c5f8f385dc307440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20=C5=81uczy=C5=84ski?= Date: Sat, 13 Nov 2021 11:29:00 +0100 Subject: [PATCH 3/3] Mention support for luajit in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c3da9a9..416515d 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ From people using z.lua: - Integrated with FZF (optional) for interactive selection and completion. - Quickly go back to a parent directory instead of typing "cd ../../..". - Corresponding experience in different shells and operating systems. -- Compatible with Lua 5.1, 5.2 and 5.3+ +- Compatible with Lua (5.1, 5.2, 5.3+) and luajit. - Self contained, distributed as a single `z.lua` script, no other dependence.