Bump yazi config
This commit is contained in:
parent
841b805565
commit
f4dee31d18
9 changed files with 135 additions and 947 deletions
|
|
@ -1,10 +0,0 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
|
||||
return {
|
||||
entry = function(_, args)
|
||||
local current = cx.active.current
|
||||
local new = (current.cursor + args[1]) % #current.files
|
||||
ya.manager_emit("arrow", { new - current.cursor })
|
||||
end,
|
||||
}
|
||||
|
||||
1
misc/.config/yazi/plugins/easyjump.yazi
Submodule
1
misc/.config/yazi/plugins/easyjump.yazi
Submodule
|
|
@ -0,0 +1 @@
|
|||
Subproject commit 6606fb1d56eea4c99809c056fd701e58890655be
|
||||
31
misc/.config/yazi/plugins/jump-to-char.yazi/main.lua
Normal file
31
misc/.config/yazi/plugins/jump-to-char.yazi/main.lua
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
local AVAILABLE_CHARS = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789."
|
||||
|
||||
local changed = ya.sync(function(st, new)
|
||||
local b = st.last ~= new
|
||||
st.last = new
|
||||
return b or not cx.active.finder
|
||||
end)
|
||||
|
||||
local escape = function(s) return s == "." and "\\." or s end
|
||||
|
||||
return {
|
||||
entry = function()
|
||||
local cands = {}
|
||||
for i = 1, #AVAILABLE_CHARS do
|
||||
cands[#cands + 1] = { on = AVAILABLE_CHARS:sub(i, i) }
|
||||
end
|
||||
|
||||
local idx = ya.which { cands = cands, silent = true }
|
||||
if not idx then
|
||||
return
|
||||
end
|
||||
|
||||
local kw = escape(cands[idx].on)
|
||||
if changed(kw) then
|
||||
ya.mgr_emit("find_do", { "^" .. kw })
|
||||
else
|
||||
ya.mgr_emit("find_arrow", {})
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
---@diagnostic disable: undefined-global
|
||||
|
||||
return {
|
||||
entry = function(self, args)
|
||||
local h = cx.active.current.hovered
|
||||
if h and h.cha.is_dir then
|
||||
ya.manager_emit("enter", {})
|
||||
return
|
||||
end
|
||||
|
||||
if #args == 0 then
|
||||
ya.manager_emit("open", {})
|
||||
end
|
||||
|
||||
if args[1] == "detatch" then
|
||||
os.execute(string.format("opener detatch \"%s\"", h.url))
|
||||
elseif args[1] == "list" then
|
||||
local f = assert(io.popen(string.format(
|
||||
"opener list \"%s\"", h.url), 'r'))
|
||||
local out = assert(f:read('*a'))
|
||||
f:close()
|
||||
ya.notify {
|
||||
title = string.format("Openers for %s:", h.name),
|
||||
content = out,
|
||||
timeout = 6.5,
|
||||
level = "info",
|
||||
}
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
35
misc/.config/yazi/plugins/smart-enter.yazi/main.lua
Normal file
35
misc/.config/yazi/plugins/smart-enter.yazi/main.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
--- @since 25.2.26
|
||||
--- @sync entry
|
||||
|
||||
local function setup(self, opts) self.open_multi = opts.open_multi end
|
||||
|
||||
local function entry(_, job)
|
||||
local h = cx.active.current.hovered
|
||||
if h and h.cha.is_dir then
|
||||
ya.manager_emit("enter", {})
|
||||
return
|
||||
end
|
||||
|
||||
if #job.args == 0 then
|
||||
ya.manager_emit("open", {})
|
||||
end
|
||||
|
||||
if job.args[1] == "detatch" then
|
||||
os.execute(string.format("opener detatch \"%s\"", h.url))
|
||||
elseif job.args[1] == "list" then
|
||||
local f = assert(io.popen(string.format(
|
||||
"opener list \"%s\"", h.url), 'r'))
|
||||
local out = assert(f:read('*a'))
|
||||
f:close()
|
||||
ya.notify {
|
||||
title = string.format("Openers for %s:", h.name),
|
||||
content = out,
|
||||
timeout = 6.5,
|
||||
level = "info",
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return { entry = entry, setup = setup }
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue