feat(yazi): update init.lua, keymap.toml and etc.
This commit is contained in:
parent
9fe47c4807
commit
61f923da47
|
@ -1,54 +1,8 @@
|
||||||
-- local function setup(_, opts)
|
|
||||||
-- local type = opts and opts.type or ui.Border.ROUNDED
|
|
||||||
-- local old_build = Tab.build
|
|
||||||
|
|
||||||
-- Tab.build = function(self, ...)
|
|
||||||
-- local bar = function(c, x, y)
|
|
||||||
-- if x <= 0 or x == self._area.w - 1 then
|
|
||||||
-- return ui.Bar(ui.Rect.default, ui.Bar.TOP)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- return ui.Bar(
|
|
||||||
-- ui.Rect { x = x, y = math.max(0, y), w = ya.clamp(0, self._area.w - x, 1), h = math.min(1, self._area.h) },
|
|
||||||
-- ui.Bar.TOP
|
|
||||||
-- ):symbol(c)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- local c = self._chunks
|
|
||||||
-- self._chunks = {
|
|
||||||
-- c[1]:padding(ui.Padding.y(1)),
|
|
||||||
-- c[2]:padding(ui.Padding(c[1].w > 0 and 0 or 1, c[3].w > 0 and 0 or 1, 1, 1)),
|
|
||||||
-- c[3]:padding(ui.Padding.y(1)),
|
|
||||||
-- }
|
|
||||||
|
|
||||||
-- local style = THEME.manager.border_style
|
|
||||||
-- self._base = ya.list_merge(self._base or {}, {
|
|
||||||
-- ui.Border(self._area, ui.Border.ALL):type(type):style(style),
|
|
||||||
-- ui.Bar(self._chunks[1], ui.Bar.RIGHT):style(style),
|
|
||||||
-- ui.Bar(self._chunks[3], ui.Bar.LEFT):style(style),
|
|
||||||
|
|
||||||
-- bar("┬", c[1].right - 1, c[1].y),
|
|
||||||
-- bar("┴", c[1].right - 1, c[1].bottom - 1),
|
|
||||||
-- bar("┬", c[2].right, c[2].y),
|
|
||||||
-- bar("┴", c[2].right, c[2].bottom - 1),
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- old_build(self, ...)
|
|
||||||
-- end
|
|
||||||
-- end
|
|
||||||
|
|
||||||
-- setup {
|
|
||||||
-- -- Available values: ui.Border.PLAIN, ui.Border.ROUNDED
|
|
||||||
-- type = ui.Border.ROUNDED,
|
|
||||||
-- }
|
|
||||||
|
|
||||||
require("full-border"):setup {
|
require("full-border"):setup {
|
||||||
-- Available values: ui.Border.PLAIN, ui.Border.ROUNDED
|
-- Available values: ui.Border.PLAIN, ui.Border.ROUNDED
|
||||||
type = ui.Border.ROUNDED,
|
type = ui.Border.ROUNDED,
|
||||||
}
|
}
|
||||||
|
|
||||||
require("archivemount"):setup()
|
require("archivemount"):setup()
|
||||||
require("chmod")
|
require("chmod")
|
||||||
require("diff")
|
require("diff")
|
||||||
require("sudo")
|
|
||||||
require("starship"):setup()
|
require("starship"):setup()
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
[[manager.prependd_keymap]]
|
[[manager.prepend_keymap]]
|
||||||
on = "<C-n>"
|
on = "<C-n>"
|
||||||
run = '''
|
run = '''
|
||||||
shell 'dragon -x -i -T "$1"' --confirm
|
shell 'dragon -x -i -T "$1"' --confirm
|
||||||
|
@ -7,62 +7,9 @@ run = '''
|
||||||
[[manager.prepend_keymap]]
|
[[manager.prepend_keymap]]
|
||||||
on = "y"
|
on = "y"
|
||||||
run = [ '''
|
run = [ '''
|
||||||
shell 'echo "$@" | xclip -i -selection clipboard -t text/uri-list' --confirm
|
shell 'echo "$@" | xclip -i -selection clipboard -t text/uri-list'
|
||||||
''', "yank" ]
|
''', "yank" ]
|
||||||
|
|
||||||
[[manager.prepend_keymap]]
|
[[manager.prepend_keymap]]
|
||||||
on = [ "m", "a" ]
|
on = "<C-y>"
|
||||||
run = "plugin archivemount --args=mount"
|
run = ["plugin system-clipboard"]
|
||||||
desc = "Mount selected archive"
|
|
||||||
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = [ "m", "u" ]
|
|
||||||
run = "plugin archivemount --args=unmount"
|
|
||||||
desc = "Unmount and save changes to original archive"
|
|
||||||
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "p", "p"]
|
|
||||||
run = "plugin sudo --args='paste'"
|
|
||||||
desc = "sudo paste"
|
|
||||||
|
|
||||||
# sudo cp/mv --force
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "P"]
|
|
||||||
run = "plugin sudo --args='paste -f'"
|
|
||||||
desc = "sudo paste"
|
|
||||||
|
|
||||||
# sudo mv
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "r"]
|
|
||||||
run = "plugin sudo --args='rename'"
|
|
||||||
desc = "sudo rename"
|
|
||||||
|
|
||||||
# sudo ln -s (absolute-path)
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "p", "l"]
|
|
||||||
run = "plugin sudo --args='link'"
|
|
||||||
desc = "sudo link"
|
|
||||||
|
|
||||||
# sudo ln -s (relative-path)
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "p", "L"]
|
|
||||||
run = "plugin sudo --args='link -r'"
|
|
||||||
desc = "sudo link relative path"
|
|
||||||
|
|
||||||
# sudo touch/mkdir
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "a"]
|
|
||||||
run = "plugin sudo --args='create'"
|
|
||||||
desc = "sudo create"
|
|
||||||
|
|
||||||
# sudo trash
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "d"]
|
|
||||||
run = "plugin sudo --args='remove'"
|
|
||||||
desc = "sudo trash"
|
|
||||||
|
|
||||||
# sudo delete
|
|
||||||
[[manager.prepend_keymap]]
|
|
||||||
on = ["R", "D"]
|
|
||||||
run = "plugin sudo --args='remove -P'"
|
|
||||||
desc = "sudo delete"
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
[plugin]
|
||||||
|
deps = [{ use = "yazi-rs/plugins:full-border", rev = "4f1d0ae" }, { use = "Lil-Dank/lazygit", rev = "c82794f" }, { use = "TD-Sky/sudo", rev = "a8287ea" }]
|
||||||
|
|
||||||
|
[flavor]
|
||||||
|
deps = [{ use = "bennyyip/gruvbox-dark", rev = "b4cc9f2" }]
|
|
@ -4,3 +4,6 @@ separator_close = ""
|
||||||
|
|
||||||
[manager]
|
[manager]
|
||||||
border_style = { bold = true }
|
border_style = { bold = true }
|
||||||
|
|
||||||
|
[flavor]
|
||||||
|
dark = "gruvbox-dark"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
[preview]
|
||||||
|
tab_size = 2
|
||||||
|
image_quality = 90
|
||||||
|
ueberzug_scale = 1
|
||||||
|
ueberzug_offset = [ 0, 0, 0, 0 ]
|
||||||
|
|
||||||
[manager]
|
[manager]
|
||||||
show_hidden = true
|
show_hidden = true
|
||||||
|
|
||||||
[preview]
|
|
||||||
image_quality = 70
|
|
||||||
|
|
Loading…
Reference in New Issue