aboutsummaryrefslogtreecommitdiff
path: root/config/yazi/init.lua
blob: c781e9bbb216f7a91bdf0efd04550df95da09613 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)