1
0
mirror of https://github.com/skywind3000/z.lua synced 2026-03-21 23:29:48 +00:00

new: -i option to cd with interactive selection

This commit is contained in:
skywind3000
2018-12-26 21:16:35 +08:00
parent 3092d82408
commit eaf499ce6e

9
z.lua
View File

@@ -4,7 +4,7 @@
-- z.lua - z.sh implementation in lua, by skywind (2018/03/19)
-- Licensed under MIT license.
--
-- Version 32, Last Modified: 2018/12/05 17:55
-- Version 33, Last Modified: 2018/12/26 21:14
--
-- * 10x times faster than fasd and autojump
-- * 3x times faster than rupa/z
@@ -21,6 +21,7 @@
-- * z -c foo # restrict matches to subdirs of $PWD
-- * z -e foo # echo the best match, don't cd
-- * z -x path # remove path from history
-- * z -i foo # cd with interactive selection
--
-- Bash Install:
-- * put something like this in your .bashrc:
@@ -1471,6 +1472,9 @@ function z_windows_init(opts)
print('set "LuaExe=' .. os.interpreter() .. '"')
print('set "LuaScript=' .. os.scriptname() .. '"')
print(script_init_cmd)
if opts.newline then
print('echo.')
end
end
@@ -1487,6 +1491,7 @@ function z_help()
print(cmd .. '-c foo # restrict matches to subdirs of $PWD')
print(cmd .. '-e foo # echo the best match, don\'t cd')
print(cmd .. '-x path # remove path from history')
print(cmd .. '-i foo # cd with interactive selection')
end
@@ -1503,3 +1508,5 @@ if not pcall(debug.getlocal, 4, 1) then
end
end