Skip to content

updating custom linemode after today's commit #1288

Closed Locked Answered by sxyazi
xfzv asked this question in 1. Q&A
Discussion options

You must be logged in to vote

Linemode has been simplified, and you can now directly extend a new custom method for Linemode:

function Linemode:custom()
  local year = os.date("%Y")
  local time = (self._file.cha.modified or 0) // 1

  if time > 0 and os.date("%Y", time) == year then
    time = os.date("%b %d %H:%M", time)
  else
    time = time and os.date("%b %d  %Y", time) or ""
  end

  local size = self._file:size()
  return ui.Line(string.format(" %s %s ", size and ya.readable_size(size):gsub(" ", "") or "-", time))
end

And make sure you have:

[manager]
linemode = "custom"

in your yazi.toml, Yazi will call your Linemode:custom() method automatically.


As for the status bar, add the following to your init.lua, ma…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
3 replies
@xfzv
Comment options

@saumyajyoti
Comment options

@sxyazi
Comment options

Answer selected by xfzv
Comment options

You must be logged in to vote
2 replies
@sxyazi
Comment options

@sxyazi
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
1. Q&A
Labels
None yet
4 participants