238. Toolhub 配置汇总
yazi
-
To override any of the defaults, begin by creating the corresponding file (from the directory linked above) to:
~/.config/yazi/on Unix-like systems.%AppData%\yazi\config\on Windows.
-
- bash/zsh
1
2
3
4
5
6
7function y() {
local tmp="$(mktemp -t "yazi-cwd.XXXXXX")" cwd
command yazi "$@" --cwd-file="$tmp"
IFS= read -r -d '' cwd < "$tmp"
[ "$cwd" != "$PWD" ] && [ -d "$cwd" ] && builtin cd -- "$cwd"
command rm -f -- "$tmp"
} - cmd
1
2
3
4
5
6
7
8
9
10
11
12@echo off
set "tmpfile=%TEMP%\yazi-cwd.txt"
del /f /q "%tmpfile%" >nul 2>nul
yazi.exe %* --cwd-file="%tmpfile%"
if exist "%tmpfile%" (
set /p cwd=<"%tmpfile%"
del /f /q "%tmpfile%" >nul 2>nul
)
if defined cwd cd /d "%cwd%"
- bash/zsh