export RIPGREP_CONFIG_PATH="$HOME/.ripgreprc"
export BAT_THEME="Dracula" # 或 "TwoDark", "Monokai Extended" 等
export EZA_COLORS="da=37:di=34"
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export GIT_PAGER="delta"
export JQ_COLORS="2;30:0;39:0;39:0;39:0;32:1;39:1;39"
--hidden
fzf_preview() { if command -v fzf &> /dev/null; then fd -t f | fzf --preview 'bat --color=always --style=numbers --line-range :500 {}' else echo "fzf 未安装" fi }
rg_replace() { if [ $# -lt 2 ]; then echo "用法: rg_replace <旧模式> <新模式> [文件类型]" return 1 fi local old=$1 local new=$2 local type=${3:-}
if [ -n "$type" ]; then
fd -e "$type" -x sd "$old" "$new" {}
else
fd -t f -x sd "$old" "$new" {}
fi
}
du_sorted() { dust -n ${1:-20} }
find_large() { local size=${1:-100M} fd -t f --size +"$size" -l | sort -k5 -h }
gdiff() { git diff --color=always "$@" | delta }
ps_search() { if [ $# -eq 0 ]; then procs else procs "$1" fi }
csv_view() { if [ $# -eq 0 ]; then echo "用法: csv_view <文件.csv> [行数]" return 1 fi local file=$1 local rows=${2:-20} xsv table "$file" | head -n "$rows" }
csv_stats() { if [ $# -eq 0 ]; then echo "用法: csv_stats <文件.csv>" return 1 fi xsv stats "$1" | xsv table }
bench_compare() {
if [
disk_report() { echo "=== 目录大小 ===" dust -n 10 echo "" echo "=== 文件系统使用 ===" duf --only local echo "" echo "=== 大文件 ===" fd -t f --size +100M -l | head -20 }
proc_report() { echo "=== 内存 Top 进程 ===" procs --sortd mem | head -20 echo "" echo "=== CPU Top 进程 ===" procs --sortd cpu | head -20 }
json_format() { if [ $# -eq 0 ]; then echo "用法: json_format <文件.json>" return 1 fi jq '.' "$1" }
json_get() { if [ $# -lt 2 ]; then echo "用法: json_get <文件.json> <字段路径>" return 1 fi jq "$2" "$1" }
yaml_format() { if [ $# -eq 0 ]; then echo "用法: yaml_format <文件.yaml>" return 1 fi yq '.' "$1" }
yaml_get() { if [ $# -lt 2 ]; then echo "用法: yaml_get <文件.yaml> <字段路径>" return 1 fi yq "$2" "$1" }
json2yaml() {
if [
yaml2json() {
if [
json_batch() {
if [
yaml_batch() {
if [