mirror of
https://github.com/skywind3000/z.lua
synced 2026-04-30 02:31:29 +00:00
update z.lua
This commit is contained in:
@@ -9,7 +9,7 @@ An alternative to [z.sh](https://github.com/rupa/z) with windows and posix shell
|
|||||||
|
|
||||||
- **10x** times faster than **fasd** and **autojump**
|
- **10x** times faster than **fasd** and **autojump**
|
||||||
- **3x** times faster than **z.sh**
|
- **3x** times faster than **z.sh**
|
||||||
- supports **posix shells**: bash, zsh, dash, sh, busybox, and etc.
|
- compatible with **posix shells**: bash, zsh, dash, sh, ash, busybox and etc.
|
||||||
- supports Windows cmd (with clink) and cmder
|
- supports Windows cmd (with clink) and cmder
|
||||||
- self contained, no dependence on awk/gawk
|
- self contained, no dependence on awk/gawk
|
||||||
|
|
||||||
|
|||||||
22
z.lua
22
z.lua
@@ -8,7 +8,8 @@
|
|||||||
--
|
--
|
||||||
-- * 10x times faster than fasd and autojump
|
-- * 10x times faster than fasd and autojump
|
||||||
-- * 3x times faster than rupa/z
|
-- * 3x times faster than rupa/z
|
||||||
-- * supports: Bash, Zsh, Posix shells and Windows cmd
|
-- * compatible with posix shells: bash, zsh, sh, ash, dash, busybox
|
||||||
|
-- * supports windows
|
||||||
--
|
--
|
||||||
-- USE:
|
-- USE:
|
||||||
-- * z foo # cd to most frecent dir matching foo
|
-- * z foo # cd to most frecent dir matching foo
|
||||||
@@ -1223,11 +1224,28 @@ function z_shell_init(opts)
|
|||||||
print(script_init_zsh)
|
print(script_init_zsh)
|
||||||
end
|
end
|
||||||
print(script_complete_zsh)
|
print(script_complete_zsh)
|
||||||
else
|
elseif opts.posix ~= nil then
|
||||||
if prompt_hook then
|
if prompt_hook then
|
||||||
print(script_init_posix)
|
print(script_init_posix)
|
||||||
end
|
end
|
||||||
print('_ZL_NOBUILTIN=1')
|
print('_ZL_NOBUILTIN=1')
|
||||||
|
else
|
||||||
|
print('if [ -n "$BASH_VERSION" ]; then')
|
||||||
|
if prompt_hook then
|
||||||
|
print(script_init_bash)
|
||||||
|
end
|
||||||
|
print(script_complete_bash)
|
||||||
|
print('elif [ -n "$ZSH_VERSION" ]; then')
|
||||||
|
if prompt_hook then
|
||||||
|
print(script_init_zsh)
|
||||||
|
end
|
||||||
|
-- print(script_complete_zsh)
|
||||||
|
print('else')
|
||||||
|
if prompt_hook then
|
||||||
|
print(script_init_posix)
|
||||||
|
end
|
||||||
|
print('_ZL_NOBUILTIN=1')
|
||||||
|
print('fi')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user