diff --git a/.config/yazi/init.lua b/.config/yazi/init.lua index 81efd17..7e64fb6 100644 --- a/.config/yazi/init.lua +++ b/.config/yazi/init.lua @@ -1,3 +1,17 @@ +-- size_and_mtime +function Linemode:size_and_mtime() + local time = math.floor(self._file.cha.mtime or 0) + if time == 0 then + time = "" + elseif os.date("%Y", time) == os.date("%Y") then + time = os.date("%b %d %H:%M", time) + else + time = os.date("%b %d %Y", time) + end + + local size = self._file:size() + return string.format("%s %s", size and ya.readable_size(size) or "-", time) +end -- full border require("full-border"):setup() -- size and time linemode @@ -61,24 +75,23 @@ require("yatline"):setup({ header_line = { left = { section_a = { - { type = "coloreds", custom = false, name = "tab_path" }, {type = "line", custom = false, name = "tabs", params = {"left"}}, }, section_b = { - {type = "coloreds", custom = false, name = "githead"}, }, section_c = { } }, right = { section_a = { - - + {type = "string", custom = false, name = "cursor_position"}, }, section_b = { - + {type = "string", custom = false, name = "cursor_percentage"}, }, section_c = { + {type = "string", custom = false, name = "hovered_ownership"}, + {type = "coloreds", custom = false, name = "permissions"}, {type = "coloreds", custom = false, name = "count"}, } } @@ -91,30 +104,27 @@ require("yatline"):setup({ }, section_b = { {type = "string", custom = false, name = "hovered_size"}, + }, section_c = { - - {type = "string", custom = false, name = "hovered_path"}, - + {type = "string", custom = false, name = "hovered_path", params = {{ trimed = false, max_length=12, trim_length=5 }}, + }, + {type = "coloreds", custom = false, name = "githead"}, } }, right = { section_a = { - {type = "string", custom = false, name = "cursor_position"}, }, section_b = { - {type = "string", custom = false, name = "cursor_percentage"}, }, section_c = { - {type = "coloreds", custom = false, name = "permissions"}, } } }, }) -- yatline-tab-path -require("yatline-tab-path"):setup() -- yatline-githead require("yatline-githead"):setup() diff --git a/.config/yazi/yazi.toml b/.config/yazi/yazi.toml index 6cbf958..49c88e1 100644 --- a/.config/yazi/yazi.toml +++ b/.config/yazi/yazi.toml @@ -1,6 +1,6 @@ [manager] show_hidden = true -linemode = "owner" +linemode = "size_and_mtime" [plugin] prepend_previewers = [