some changes

This commit is contained in:
pika 2024-11-11 15:16:05 +01:00
parent ab075c85f7
commit 4d1d6c926e
3 changed files with 42 additions and 0 deletions

View file

@ -1,6 +1,37 @@
-- ─< full 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,
}) })
-- ─< show groups and user in status bar >──────────────────────────────────────────────
Status:children_add(function()
local h = cx.active.current.hovered
if h == nil or ya.target_family() ~= "unix" then
return ui.Line({})
end
return ui.Line({
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
ui.Span(":"),
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
ui.Span(" "),
})
end, 500, Status.RIGHT)
-- ─< show "user@host" in header >──────────────────────────────────────────────────────
Header:children_add(function()
if ya.target_family() ~= "unix" then
return ui.Line({})
end
return ui.Span(ya.user_name() .. "@" .. ya.host_name() .. ":"):fg("blue")
end, 500, Header.LEFT)
-- ─< git settings >────────────────────────────────────────────────────────────────────
require("git"):setup() require("git"):setup()
-- ~/.config/yazi/init.lua
THEME.git = THEME.git or {}
THEME.git.modified = ui.Style():fg("blue")
THEME.git.deleted = ui.Style():fg("red"):bold()
require("omp"):setup()

View file

@ -323,6 +323,10 @@ keymap = [
{ on = "f", run = "filter", desc = "Apply a filter for the help items" }, { on = "f", run = "filter", desc = "Apply a filter for the help items" },
] ]
# ╭────────────────╮
# │ custom keymaps │
# ╰────────────────╯
[[manager.prepend_keymap]] [[manager.prepend_keymap]]
on = "!" on = "!"
run = 'shell "$SHELL" --block --confirm' run = 'shell "$SHELL" --block --confirm'
@ -332,3 +336,8 @@ desc = "Open shell here"
on = "l" on = "l"
run = "plugin --sync smart-enter" run = "plugin --sync smart-enter"
desc = "Enter the child directory, or open the file" desc = "Enter the child directory, or open the file"
[[manager.prepend_keymap]]
on = [ "c", "m" ]
run = "plugin chmod"
desc = "Chmod on selected files"

View file

@ -2,6 +2,8 @@
deps = [ deps = [
{ use = "yazi-rs/plugins:full-border" }, { use = "yazi-rs/plugins:full-border" },
{ use = "yazi-rs/plugins:git" }, { use = "yazi-rs/plugins:git" },
{ use = "yazi-rs/plugins:chmod" },
{ use = "saumyajyoti/omp" },
] ]
[flavor] [flavor]