Show modified time of the file under the cursor on the status line #1658
GeordyJ
started this conversation in
2. Show and tell
Replies: 2 comments 5 replies
-
|
I would like if this is on by default. Same as |
Beta Was this translation helpful? Give feedback.
5 replies
-
|
Thank you, I was looking for something like this. Here is modified variant, displaying both B and Mtime in different format: Status:children_add(function()
local h = cx.active.current.hovered
local elements = {}
local btime_formatted = nil
if h and h.cha and h.cha.btime then
local timestamp_num = tonumber(h.cha.btime)
if timestamp_num and timestamp_num > 0 then
btime_formatted = os.date("%Y-%m-%d %H:%M", math.floor(timestamp_num))
end
end
local mtime_formatted = nil
if h and h.cha and h.cha.mtime then
local timestamp_num = tonumber(h.cha.mtime)
if timestamp_num and timestamp_num > 0 then
mtime_formatted = os.date("%Y-%m-%d %H:%M", math.floor(timestamp_num))
end
end
if btime_formatted then
table.insert(elements, ui.Span("B:"):fg("cyan"))
table.insert(elements, ui.Span(btime_formatted.. " "):fg("blue"))
end
if mtime_formatted then
table.insert(elements, ui.Span("M:"):fg("cyan"))
table.insert(elements, ui.Span(mtime_formatted.. " "):fg("blue"))
end
return ui.Line(elements)
end, 500, Status.RIGHT) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I just wanted to share how I was able to add the modified time of the file under the cursor in the status line. You just need to add the following code to the
yazi/init.luafile. I prefer this rather than using the linemodes.You can modify it to see other properties, see the docs
Beta Was this translation helpful? Give feedback.
All reactions