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
|
-- full border
|
||||||
require("full-border"):setup()
|
require("full-border"):setup()
|
||||||
-- size and time linemode
|
-- size and time linemode
|
||||||
|
@ -61,24 +75,23 @@ require("yatline"):setup({
|
||||||
header_line = {
|
header_line = {
|
||||||
left = {
|
left = {
|
||||||
section_a = {
|
section_a = {
|
||||||
{ type = "coloreds", custom = false, name = "tab_path" },
|
|
||||||
{type = "line", custom = false, name = "tabs", params = {"left"}},
|
{type = "line", custom = false, name = "tabs", params = {"left"}},
|
||||||
},
|
},
|
||||||
section_b = {
|
section_b = {
|
||||||
{type = "coloreds", custom = false, name = "githead"},
|
|
||||||
},
|
},
|
||||||
section_c = {
|
section_c = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
right = {
|
right = {
|
||||||
section_a = {
|
section_a = {
|
||||||
|
{type = "string", custom = false, name = "cursor_position"},
|
||||||
|
|
||||||
},
|
},
|
||||||
section_b = {
|
section_b = {
|
||||||
|
{type = "string", custom = false, name = "cursor_percentage"},
|
||||||
},
|
},
|
||||||
section_c = {
|
section_c = {
|
||||||
|
{type = "string", custom = false, name = "hovered_ownership"},
|
||||||
|
{type = "coloreds", custom = false, name = "permissions"},
|
||||||
{type = "coloreds", custom = false, name = "count"},
|
{type = "coloreds", custom = false, name = "count"},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -91,30 +104,27 @@ require("yatline"):setup({
|
||||||
},
|
},
|
||||||
section_b = {
|
section_b = {
|
||||||
{type = "string", custom = false, name = "hovered_size"},
|
{type = "string", custom = false, name = "hovered_size"},
|
||||||
|
|
||||||
},
|
},
|
||||||
section_c = {
|
section_c = {
|
||||||
|
{type = "string", custom = false, name = "hovered_path", params = {{ trimed = false, max_length=12, trim_length=5 }},
|
||||||
{type = "string", custom = false, name = "hovered_path"},
|
},
|
||||||
|
{type = "coloreds", custom = false, name = "githead"},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
right = {
|
right = {
|
||||||
section_a = {
|
section_a = {
|
||||||
{type = "string", custom = false, name = "cursor_position"},
|
|
||||||
},
|
},
|
||||||
section_b = {
|
section_b = {
|
||||||
{type = "string", custom = false, name = "cursor_percentage"},
|
|
||||||
},
|
},
|
||||||
section_c = {
|
section_c = {
|
||||||
|
|
||||||
|
|
||||||
{type = "coloreds", custom = false, name = "permissions"},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
-- yatline-tab-path
|
-- yatline-tab-path
|
||||||
require("yatline-tab-path"):setup()
|
|
||||||
-- yatline-githead
|
-- yatline-githead
|
||||||
require("yatline-githead"):setup()
|
require("yatline-githead"):setup()
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[manager]
|
[manager]
|
||||||
show_hidden = true
|
show_hidden = true
|
||||||
linemode = "owner"
|
linemode = "size_and_mtime"
|
||||||
|
|
||||||
[plugin]
|
[plugin]
|
||||||
prepend_previewers = [
|
prepend_previewers = [
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue