major refactor and reorg
This commit is contained in:
parent
0a9342ea3e
commit
332b345753
11 changed files with 290 additions and 78 deletions
17
modules/home/yazi/default.nix
Normal file
17
modules/home/yazi/default.nix
Normal file
|
@ -0,0 +1,17 @@
|
|||
{ inputs, ... }:
|
||||
{
|
||||
yazi = {
|
||||
enable = true;
|
||||
enableFishIntegration = true;
|
||||
package = inputs.yazi.packages.x86_64-linux.default;
|
||||
initLua = ./init.lua;
|
||||
keymap = {
|
||||
input.prepend_keymap = [
|
||||
{ on = "<C-d>"; run = "shell 'ripdrag \"$@\" -x 2>/dev/null &' --confirm"; }
|
||||
{ on = "y"; run = ["shell 'for path in \"$@\"; do echo \"file://$path\"; done | wl-copy -t text/uri-list'\n" "yank"]; }
|
||||
{ on = ["g" "r"]; run = "shell 'ya emit cd \"$(git rev-parse --show-toplevel)\"'\n"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
23
modules/home/yazi/init.lua
Normal file
23
modules/home/yazi/init.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
-- adds user and group of hovered file/dir to status bar
|
||||
Status:children_add(function(self)
|
||||
local h = self._current.hovered
|
||||
if h and h.link_to then
|
||||
return " -> " .. tostring(h.link_to)
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end, 3300, Status.LEFT)
|
||||
|
||||
Status:children_add(function()
|
||||
local h = cx.active.current.hovered
|
||||
if h == nil or ya.target_family() ~= "unix" then
|
||||
return ""
|
||||
end
|
||||
|
||||
return ui.Line {
|
||||
ui.Span(ya.user_name(h.cha.uid) or tostring(h.cha.uid)):fg("magenta"),
|
||||
":",
|
||||
ui.Span(ya.group_name(h.cha.gid) or tostring(h.cha.gid)):fg("magenta"),
|
||||
" ",
|
||||
}
|
||||
end, 500, Status.RIGHT)
|
Loading…
Add table
Add a link
Reference in a new issue