add fish config

This commit is contained in:
FlintyLemming
2025-12-19 14:05:47 +08:00
parent a7e11e85e5
commit 83053a3e42

View File

@@ -54,25 +54,8 @@ function restore_cursor --on-event fish_postexec
tput cnorm
end
# --- 自动化 Locale 修复逻辑 ---
# 只有在当前环境不支持 UTF-8 时才介入,修复例如 nano 无法输入中文的问题
if not string match -qi "*UTF-8" "$LANG"
# 定义尝试顺序C.UTF-8 (最通用) -> en_US.UTF-8 (最标准) -> 其他已安装的 UTF-8
if locale -a | string match -q "C.utf8"
set -gx LANG C.UTF-8
set -gx LC_ALL C.UTF-8
else if locale -a | string match -qi "en_US.utf8"
set -gx LANG en_US.UTF-8
set -gx LC_ALL en_US.UTF-8
else
# 如果以上都没有,自动寻找系统里任何一个可用的 UTF-8 语言包
set -l any_utf8 (locale -a | string match -ri '.*\.utf8' | head -n 1)
if test -n "$any_utf8"
set -gx LANG $any_utf8
set -gx LC_ALL $any_utf8
end
end
end
abbr -a port 'sudo ss -tulnp | grep'
abbr -a process 'ps aux | grep'