diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2024-11-21 13:52:20 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2024-11-21 13:52:20 +0100 |
| commit | c11369732bd59e26b19ff932e27ad18956e48dfc (patch) | |
| tree | 0d54fc1d694c8d9f319d9f9552485c115fe68ac5 /config/yazi/init.lua | |
| parent | 1cb65f44bc813fa4e4b24d518714736761f7e544 (diff) | |
| download | dotfiles-c11369732bd59e26b19ff932e27ad18956e48dfc.tar.gz dotfiles-c11369732bd59e26b19ff932e27ad18956e48dfc.tar.bz2 dotfiles-c11369732bd59e26b19ff932e27ad18956e48dfc.zip | |
Update yazi with nice rice
Diffstat (limited to 'config/yazi/init.lua')
| -rw-r--r-- | config/yazi/init.lua | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/config/yazi/init.lua b/config/yazi/init.lua new file mode 100644 index 0000000..c781e9b --- /dev/null +++ b/config/yazi/init.lua @@ -0,0 +1,24 @@ +require("git"):setup() + +-- Add the user and group in the status line (from: https://yazi-rs.github.io/docs/tips#user-group-in-status) +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) + +-- Add hostname and username in header (from: https://yazi-rs.github.io/docs/tips#username-hostname-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) |
