лучше не лезьте

This commit is contained in:
2024-09-22 19:29:25 +04:00
parent 94e0023367
commit de3262e579
27 changed files with 1305 additions and 421 deletions

View File

@@ -41,3 +41,7 @@ setup {
-- Available values: ui.Border.PLAIN, ui.Border.ROUNDED
type = ui.Border.ROUNDED,
}
require("archivemount"):setup()
require("chmod")
require("starship").setup()

21
yazi/keymap.toml Normal file
View File

@@ -0,0 +1,21 @@
[[manager.prepend_keymap]]
on = "<C-n>"
run = '''
shell 'dragon -x -i -T "$1"' --confirm
'''
[[manager.prepend_keymap]]
on = "y"
run = [ '''
shell 'echo "$@" | xclip -i -selection clipboard -t text/uri-list' --confirm
''', "yank" ]
[[manager.prepend_keymap]]
on = [ "m", "a" ]
run = "plugin archivemount --args=mount"
desc = "Mount selected archive"
[[manager.prepend_keymap]]
on = [ "m", "u" ]
run = "plugin archivemount --args=unmount"
desc = "Unmount and save changes to original archive"

Submodule yazi/plugins/archivemount.yazi added at 354a4d6df9

View File

@@ -0,0 +1,39 @@
local selected_or_hovered = ya.sync(function()
local tab, paths = cx.active, {}
for _, u in pairs(tab.selected) do
paths[#paths + 1] = tostring(u)
end
if #paths == 0 and tab.current.hovered then
paths[1] = tostring(tab.current.hovered.url)
end
return paths
end)
return {
entry = function()
ya.manager_emit("escape", { visual = true })
local urls = selected_or_hovered()
if #urls == 0 then
return ya.notify { title = "Chmod", content = "No file selected", level = "warn", timeout = 5 }
end
local value, event = ya.input {
title = "Chmod:",
position = { "top-center", y = 3, w = 40 },
}
if event ~= 1 then
return
end
local status, err = Command("chmod"):arg(value):args(urls):spawn():wait()
if not status or not status.success then
ya.notify {
title = "Chmod",
content = string.format("Chmod with selected files failed, exit code %s", status and status.code or err),
level = "error",
timeout = 5,
}
end
end,
}

Submodule yazi/plugins/starship.yazi added at 20d5a4d454

View File

@@ -2,5 +2,4 @@
show_hidden = true
[preview]
image_uality = 90
image_quality = 70