Adding absolute or relative path of file to statusline. #1915
Unanswered
magnusriga
asked this question in
1. Q&A
Replies: 2 comments 8 replies
-
Add this to your main function Status:name()
local h = self._tab.current.hovered
if not h then
return ui.Line({})
end
return ui.Line(" " .. tostring(h.url))
end Hope it solves your issue :) |
Beta Was this translation helpful? Give feedback.
5 replies
-
Thank you both The below works, but is it not possible to use envs in the prefix string? I could not make Thank you. function Status:name()
local h = self._tab.current.hovered
local url = h.url
local home_prefix = "/home/magnus"
if not h then
return ui.Line({})
end
if url:starts_with(home_prefix) then
url = Url("~/"):join(url:strip_prefix(home_prefix))
end
local linked = ""
if h.link_to ~= nil then
linked = " -> " .. tostring(h.link_to)
end
return ui.Line(" " .. url .. linked)
end |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
What system are you running Yazi on?
Linux X11
What terminal are you running Yazi in?
Wezterm
yazi --debug
outputDescribe the question
Thanks for an awesome program.
Question: When browsing with yazi, I currently do not see which folder I am in. Example:
It would be great if the actual path to the folder I am in would be showed somewhere. For instance, as part of the file name in the status line. Either relative (from pwd) or absolute, would work well.
Is that possible?
Thanks again.
Anything else?
No response
Validations
Beta Was this translation helpful? Give feedback.
All reactions