yazi config

This commit is contained in:
thek4n 2026-07-17 12:43:59 +03:00
parent ee76511d46
commit 18c297347d
5 changed files with 46 additions and 1 deletions

View File

@ -0,0 +1,13 @@
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

View File

@ -0,0 +1,21 @@
[mgr]
sort_by = "natural"
sort_dir_first = false
linemode = "size_and_mtime"
show_symlink = true
[preview]
wrap = "no"
tab_size = 4
[opener]
play = [
{ run = "mpv %s", orphan = true, for = "unix" },
]
edit = [
{ run = "cd \"${YAZI_ORIGINAL_CWD:-${PWD}}\" && ${EDITOR} %s", block = true, for = "unix" },
]
open = [
{ run = "xdg-open %s1", desc = "Open" },
]

View File

@ -75,6 +75,10 @@ alias beeptime='beep -D 400 -l 400 -r "$(date +%I)" -f 440 -n -D 1000 -l 0 -n -D
alias vi='nvim'
alias svi="sudo --preserve-env nvim"
# Yazi
alias ya='YAZI_ORIGINAL_CWD="${PWD}" \yazi'
alias yazi='ya'
# git
for al in s d di co col cob ds u ps pst pl pr hs last lastd df amend br fuck sw swl swc swb
do

View File

@ -70,3 +70,10 @@ cargo-init() {
cargo init "${1}" && cd "${1}" && \
return "${?}"
}
yacd() {
local tmp="$(mktemp -t "yazi-cwd.XXXXX")"
yazi "${@}" --cwd-file="${tmp}"
cd "$(cat "${tmp}")"
rm -f "${tmp}" >/dev/null
}