Skip to content

Instantly share code, notes, and snippets.

@masato3
Last active June 23, 2026 21:51
Show Gist options
  • Select an option

  • Save masato3/43e0727ca0953c83d80efebffe1ea833 to your computer and use it in GitHub Desktop.

Select an option

Save masato3/43e0727ca0953c83d80efebffe1ea833 to your computer and use it in GitHub Desktop.
Yazi 設定ファイル init.lua
-- 行表示 サイズ/日付
-- https://github.com/sxyazi/yazi/discussions/1643
function Linemode:size_and_mtime()
local time = math.floor(self._file.cha.mtime or 0)
local time_str
if time == 0 then
time_str = ""
else
time_str = os.date("%x %H:%M", time)
end
local size = self._file:size()
local size_str = size and ya.readable_size(size) or ""
if size then
return string.format("%s %s", size_str, time_str)
else
return string.format("%s", time_str)
end
end
function Linemode:mtime()
local time = math.floor(self._file.cha.mtime or 0)
local time_str
if time == 0 then
time_str = ""
else
time_str = os.date("%x %H:%M", time)
end
return time_str
end
function Linemode:btime()
local time = math.floor(self._file.cha.btime or 0)
local time_str
if time == 0 then
time_str = ""
else
time_str = os.date("%x %H:%M", time)
end
return time_str
end
function Linemode:my_default()
return self:size_and_mtime()
end
-- ------------------------------------------------------------------
-- plugin
-- close-and-restore-tab.yazi
require("close-and-restore-tab"):setup()
-- copy-file-contents.yazi
require("copy-file-contents"):setup({
notification = true
})
-- eza-preview.yazi
require("eza-preview"):setup({
default_tree = true,
level = 2
})
-- git.yazi
require("git"):setup {
order = 1500
}
-- smart-enter.yazi
-- 複数選択ファイル実行可能
require("smart-enter"):setup {
open_multi = true
}
-- yatline.yazi
-- https://github.com/imsi32/yatline.yazi/wiki#minimal-config
require("yatline"):setup({
style_a = {
bg = "white",
fg = "white",
bg_mode = {
normal = "#03377f",
select = "#5f5f02",
un_set = "#6b0303"
},
},
style_b = { bg = "#2f4159", fg = "brightwhite" },
header_line = {
left = {
section_a = {
{ type = "line", name = "tabs" }
},
section_b = {
-- yatline-githead.yazi
{ type = "coloreds", custom = false, name = "githead" }
},
section_c = {}
},
right = {
section_a = {
{ type = "coloreds", custom = true, name = { { " 󰇥 ", "white" } } }
},
}
},
})
-- yatline-githead.yazi
require("yatline-githead"):setup()
-- zoxide
-- CWD変更のあとにzoxideデータベースへパス追加
-- https://yazi-rs.github.io/docs/plugins/builtins/#options
require("zoxide"):setup({
update_db = true
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment