# 1. 바이너리 설치 (가장 빠름)curl-sLhttps://github.com/sxyazi/yazi/releases/latest/download/yazi-x86_64-unknown-linux-gnu.zip-o/tmp/yazi.zipunzip/tmp/yazi.zip-d/tmp/yazicd/tmp/yazi/yazi-x86_64-unknown-linux-gnumvyaziya~/.local/bin/# 확인whichyaziyazi--version
fish함수 생성
# yazi용 fish 함수 생성mkdir-p~/.config/fish/functionscat>~/.config/fish/functions/y.fish<< 'EOF'function y set tmp (mktemp -t "yazi-cwd.XXXXXX") yazi $argv --cwd-file="$tmp" if set cwd (command cat -- "$tmp"); and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ] builtin cd -- "$cwd" end rm -f -- "$tmp"endEOF
테스트
# fish reloadexecfish# yazi 실행 (cd on quit 기능 포함)y# 또는 직접yazi
curl--proto'=https'--tlsv1.2-sSfhttps://sh.rustup.rs|sh# 실행 중 1번 선택1) Proceed with installation (default)2) Customize installation3) Cancel installation
# fish를 기본 셸로 등록 (안 하면 zsh 유지하면서 fish만 실행 가능)whichfish# 출력 예: /opt/homebrew/bin/fish 또는 /usr/bin/fish# 기본 셸 변경chsh-s$(which fish)# 또는 수동으로sudochsh-s/opt/homebrew/bin/fish $USER
# 설정 디렉토리 생성mkdir-p~/.config/fish/functionsmkdir-p~/.config/fish/completions# 기본 설정 파일 생성touch~/.config/fish/config.fish# ip 함수 touch~/.config/fish/functions/ip.fish# starship.toml -> 테마touch~/.config/starship.toml
~/.config/fish/config.fish
# ==================================================================# 1. Environment Variables & Path# ==================================================================# Path Configuration (zshrc에서 복사 + ~/.local/bin/env 내용 반영)set-xPATH $HOME/.local/bin $HOME/.cargo/bin $HOME/.local/share/gem/ruby/3.0.0/bin $PATH# Load acme.sh env if exists (fish compatible)iftest-f"$HOME/.acme.sh/acme.sh.env"# acme.sh.env도 bash 문법일 수 있으므로 주의# 간단한 export만 있다면 직접 설정set-xACME_DIRECTORY"https://acme-v02.api.letsencrypt.org/directory"end# =================================================================# 2. Tool Specific Settings# =================================================================# fzf optimization (Use fd/fdfind if installed)ifcommand-vfdfind>/dev/null2>&1set-xFZF_DEFAULT_COMMAND'fdfind --type f --hidden --follow --exclude .git'aliasfd="fdfind"elseifcommand-vfd>/dev/null2>&1set-xFZF_DEFAULT_COMMAND'fd --type f --hidden --follow --exclude .git'endifset-qFZF_DEFAULT_COMMANDset-xFZF_CTRL_T_COMMAND $FZF_DEFAULT_COMMANDend# fzf fish integration (버전 확인)ifcommand-vfzf>/dev/null2>&1# 최신 fzf (0.48+)용fzf--fish2>/dev/null|source# 또는 이전 버전용# source (fzf --fish 2>/dev/null)end# ================================================================# 3. Abbreviations (zsh alias → fish abbr)# ================================================================# Safety First (Prevent accidental deletions/overwrites)abbr-acp'cp -i'abbr-amv'mv -i'abbr-arm'rm -i'# Navigation & Listing (eza)ifcommand-veza>/dev/null2>&1abbr-als'eza --icons -F'abbr-all'eza -lhg -F --group-directories-first --octal-permissions --time-style long-iso --icons'abbr-al'eza -lhag -F --group-directories-first --octal-permissions --time-style long-iso --icons'abbr-alt'eza --tree --icons'elseabbr-als'ls -F --color=auto'abbr-all'ls -lh --color=auto'abbr-al'ls -lah --color=auto'end# General Utilitiesabbr-acc'clear'abbr-avim'nvim'abbr-avi'nvim'abbr-acat'batcat'abbr-aman'tldr'abbr-awt'curl wttr.in/busan?lang=ko'# System Maintenanceabbr-auu'sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y'# Dockerabbr-adps'docker ps --format "table {{.Names}}\t{{.Image}}\t{{.Ports}}"'abbr-adcps'docker compose ps --format "table {{.Names}}\t{{.Image}}\t{{.Ports}}"'# Git (oh-my-zsh 기본 alias들)abbr-ag'git'abbr-aga'git add'abbr-agaa'git add --all'abbr-agb'git branch'abbr-agba'git branch -a'abbr-agbd'git branch -d'abbr-agc'git commit -v'abbr-agcmsg'git commit -m'abbr-agco'git checkout'abbr-agcp'git cherry-pick'abbr-agd'git diff'abbr-agf'git fetch'abbr-agl'git pull'abbr-aglg'git log --stat'abbr-agp'git push'abbr-agpf'git push --force-with-lease'abbr-agrb'git rebase'abbr-agrba'git rebase --abort'abbr-agrbc'git rebase --continue'abbr-agrbi'git rebase -i'abbr-agrh'git reset'abbr-agrhh'git reset --hard'abbr-agrm'git rm'abbr-agst'git status'abbr-agsw'git switch'abbr-agswc'git switch -c'# =============================================================# 4. Functions (zsh functions → fish functions)# =============================================================# sudo wrapper to use nvimfunctionsudo if test "$argv[1]" = "vi" command sudo nvim $argv[2..-1] else command sudo $argv endend# zoxide가 있을 때만 abbr 설정if command -v zoxide >/dev/null 2>&1 zoxide init fish | source # cd는 원래대로 두고, z만 스마트 점프 # (기존abbr-acd'z'는제거하고아래처럼)# z로 점프, cd는 정상 cdabbr-az'z'abbr-azi'zi'# 대화형 선택end# ===========================================================# 5. Starship Prompt# ===========================================================starshipinitfish|source
~/.config/starship.toml (Powerlevel10k 스타일)
# =============================================================# Starship Config - Powerlevel10k Style# =============================================================add_newline =truecommand_timeout =1000# Character (prompt symbol)[character]success_symbol ="[❯](bold green)"error_symbol ="[❯](bold red)"vimcmd_symbol ="[❮](bold green)"# Directory (truncate like p10k)[directory]truncation_length =3truncate_to_repo =truefish_style_pwd_dir_length =1format ="[$path]($style)[$read_only]($read_only_style) "style ="blue bold"# Git (rich info like p10k)[git_branch]symbol =""style ="bold purple"[git_status]staged ="[+](green)"modified ="[~](yellow)"untracked ="[?](red)"conflicted ="[=](red)"ahead ="[⇡](green)"behind ="[⇣](red)"diverged ="[⇕](red)"stashed ="[$](cyan)"# Language versions (only show when relevant)[nodejs]format ="via [ $version](bold green) "detect_files =["package.json",".node-version",".nvmrc"]detect_extensions =["js","mjs","cjs","ts","tsx","jsx"][python]format ="via [🐍 $version](bold blue) "detect_files =["requirements.txt","pyproject.toml","setup.py","Pipfile"]detect_extensions =["py"][rust]format ="via [🦀 $version](bold red) "detect_files =["Cargo.toml"]# Go - 모듈 이름을 'golang'으로 변경하거나 최소한으로 설정[golang]format ="via [🐹 $version](bold cyan) "detect_files =["go.mod"]detect_extensions =["go"]# Cloud/K8s[aws]format ='[$profile](bold yellow) 'symbol ="☁️ "[kubernetes]format ='[$context](bold blue) 'symbol ="☸️ "disabled =false# Execution time (show if > 2s)[cmd_duration]min_time =2_000format ="[ $duration](yellow)"# Battery (for laptop)[battery]full_symbol ="🔋 "charging_symbol ="⚡️ "discharging_symbol ="💀 "disabled =false# Time (optional)[time]disabled =trueformat ="[$time]($style) "time_format ="%H:%M"# Jobs (background tasks)[jobs]symbol ="✦ "style ="bold red"# Hostname (show on SSH)[hostname]ssh_only =trueformat ="[$hostname](bold yellow) "
~/.config/fish/functions/ip.fish (ip a, ip addr 명령시 ip 부분 색상 강조)
functionip --wraps ip --description 'Enhanced ip command with colors (fromzshrc)' command ip $argv | awk '# Highlight Interface Names (blue bold)/^[0-9]+: [^:]+:/ {gsub(/^([0-9]+: [^:]+:)/, "\033[1;34m&\033[0m");print$0;next}# IPv4 (green bold)/inet/{gsub(/inet/,"\033[1;32minet \033[0m");gsub(/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+\/[0-9]+/,"\033[1;32m&\033[0m");print$0;next }# IPv6 (cyan bold)/inet6/{gsub(/inet6/,"\033[1;36minet6 \033[0m");gsub(/[0-9a-f:]+\/[0-9]+/,"\033[1;36m&\033[0m");print$0;next }{print$0}'end
✅ 추가 권장 패키지
# fisher 설치 (선택)curl-sLhttps://raw.githubusercontent.com/jorgebucaran/fisher/main/functions/fisher.fish|source&&fisherinstalljorgebucaran/fisher# zsh에서 쓰던 도구들 fish 버전fisherinstalljorgebucaran/nvm.fish# nvm 대체fisherinstallpatrickf1/fzf.fish# fzf 통합 강화fisherinstalljethrokuan/z# z 디렉토리 점프 (zoxide 없을 때)