cross-platform dotfiles: OS별 분기 및 자동 설치 스크립트 추가
- config.fish: macOS/Linux 분기 (PATH, credential, clipboard, 컨테이너) - tmux.conf: fish 경로 자동감지, pbcopy/xclip 분기 - gitconfig: credential helper를 .gitconfig.local로 분리 - install.sh: 전체 개발환경 원스톱 설치 (fish, nvim, kitty, fzf, rg, fd, delta, lazygit, go, rust, uv, claude 등) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,52 +1,57 @@
|
||||
# OS 감지
|
||||
set -g __os (uname)
|
||||
|
||||
# Fix fish_complete_path (중복 방지)
|
||||
if not contains ~/.config/fish/completions $fish_complete_path
|
||||
set -g fish_complete_path ~/.config/fish/completions $fish_complete_path
|
||||
end
|
||||
|
||||
if status is-interactive
|
||||
# Commands to run in interactive sessions can go here
|
||||
# Set default Node.js version
|
||||
nvm use 20 --silent
|
||||
# Add uv to PATH
|
||||
fish_add_path $HOME/.local/bin
|
||||
|
||||
# kitty integration 최적화
|
||||
# 공통 PATH
|
||||
fish_add_path $HOME/.local/bin
|
||||
fish_add_path $HOME/.cargo/bin
|
||||
test -d /usr/local/go/bin && fish_add_path /usr/local/go/bin
|
||||
|
||||
# ── OS별 PATH ──
|
||||
if test "$__os" = Linux
|
||||
fish_add_path $HOME/.local/kitty.app/bin
|
||||
else if test "$__os" = Darwin
|
||||
fish_add_path /Users/kaffa/.antigravity/antigravity/bin
|
||||
end
|
||||
|
||||
# ── kitty integration ──
|
||||
if test "$TERM" = xterm-kitty
|
||||
# kitty shell integration 설정
|
||||
alias icat="kitty +kitten icat"
|
||||
alias kdiff="kitty +kitten diff"
|
||||
|
||||
# 빠른 디렉토리 이동 (kitty의 프롬프트 마킹 활용)
|
||||
bind \cg 'history | fzf | read -l result; and commandline $result'
|
||||
|
||||
# 파일 미리보기
|
||||
alias preview="fzf --preview 'if test -d {}; eza -la {}; else; bat --color=always {}; end'"
|
||||
|
||||
# tmux 유틸리티 함수들
|
||||
# tmux 유틸리티
|
||||
alias tm="tmux"
|
||||
alias tma="tmux attach-session -t"
|
||||
alias tmn="tmux new-session -s"
|
||||
alias tml="tmux list-sessions"
|
||||
alias tmk="tmux kill-session -t"
|
||||
|
||||
# kitten 유틸리티 alias들
|
||||
# kitten 유틸리티
|
||||
alias clipboard="kitty +kitten clipboard"
|
||||
alias img="kitty +kitten icat"
|
||||
alias unicode="kitty +kitten unicode_input"
|
||||
alias hgrep="kitty +kitten hyperlinked_grep"
|
||||
|
||||
# 이미지 갤러리 함수 (간단한 alias로 변경)
|
||||
alias imgls="find . -maxdepth 1 -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' -o -name '*.gif' -o -name '*.webp' \) | head -5 | xargs -I {} kitty +kitten icat --align center {}"
|
||||
end
|
||||
end
|
||||
|
||||
# Vault Configuration
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
# 환경 변수 (공통)
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
|
||||
set -x VAULT_ADDR "https://vault.anvil.it.com"
|
||||
set -x VAULT_TOKEN "hvs.o7JrzES15uuXRmvlKAJKEaTv"
|
||||
|
||||
# Gitea Configuration
|
||||
set -gx GITEA_URL "https://gitea.anvil.it.com"
|
||||
set -gx GITEA_TOKEN (security find-internet-password -s gitea.anvil.it.com -a kaffa -w 2>/dev/null)
|
||||
|
||||
# Cloudflare Configuration - Lazy Loading
|
||||
function load_cloudflare_credentials
|
||||
@@ -57,41 +62,54 @@ function load_cloudflare_credentials
|
||||
end
|
||||
end
|
||||
|
||||
# Auto-load when using cf command
|
||||
if command -v cf >/dev/null
|
||||
alias cf='load_cloudflare_credentials && command cf'
|
||||
end
|
||||
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
# Alias (공통)
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
|
||||
alias vi=nvim
|
||||
alias ssh=tssh
|
||||
alias docker "limactl shell docker -- docker"
|
||||
alias podman "limactl shell podman -- podman"
|
||||
alias ss='netstat -an'
|
||||
|
||||
# Set default editor for Claude Code /memory command
|
||||
set -Ux VISUAL nvim
|
||||
set -Ux EDITOR nvim
|
||||
|
||||
# Added by Antigravity
|
||||
fish_add_path /Users/kaffa/.antigravity/antigravity/bin
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
# OS별 설정
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
|
||||
if test "$__os" = Darwin
|
||||
# macOS: keychain에서 Gitea 토큰 로드
|
||||
set -gx GITEA_TOKEN (security find-internet-password -s gitea.anvil.it.com -a kaffa -w 2>/dev/null)
|
||||
# macOS: Lima 기반 컨테이너
|
||||
alias docker "limactl shell docker -- docker"
|
||||
alias podman "limactl shell podman -- podman"
|
||||
alias ss='netstat -an'
|
||||
else if test "$__os" = Linux
|
||||
# Linux: 환경변수 또는 vault에서 Gitea 토큰 로드
|
||||
if not set -q GITEA_TOKEN
|
||||
set -gx GITEA_TOKEN (vault kv get -field=api_token secret/apps/gitea 2>/dev/null || echo "")
|
||||
end
|
||||
alias ss='ss -tulnp'
|
||||
end
|
||||
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
# Claude Code tmux 단축키
|
||||
# ══════════════════════════════════════════════════════════════════
|
||||
|
||||
# Claude 세션 빠른 시작
|
||||
alias tc='tmux-claude'
|
||||
|
||||
# 현재 디렉토리에서 Claude 세션
|
||||
alias tcc='tmux-claude (pwd)'
|
||||
|
||||
# tmux 패널 내용 복사 (최근 1000줄)
|
||||
function tcopy
|
||||
tmux capture-pane -pS -1000 | pbcopy
|
||||
if test "$__os" = Darwin
|
||||
tmux capture-pane -pS -1000 | pbcopy
|
||||
else
|
||||
tmux capture-pane -pS -1000 | xclip -selection clipboard
|
||||
end
|
||||
echo "패널 내용 복사됨 (최근 1000줄)"
|
||||
end
|
||||
|
||||
# Claude 응답 검색 (tmux 히스토리에서)
|
||||
function csearch
|
||||
tmux copy-mode
|
||||
tmux send-keys "?" "$argv" Enter
|
||||
|
||||
Reference in New Issue
Block a user