improve yazi configuration
This commit is contained in:
parent
4afd424435
commit
e425915f37
2 changed files with 23 additions and 13 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue