98 lines
4.3 KiB
Fish
98 lines
4.3 KiB
Fish
# Fish shell configuration
|
|
# Ported from Zsh config — Fish + Starship + Zellij + Ghostty stack
|
|
|
|
if status is-interactive
|
|
|
|
# ── Prompt ──────────────────────────────────────────────
|
|
starship init fish | source
|
|
|
|
# ── Navigation ──────────────────────────────────────────
|
|
zoxide init fish | source
|
|
|
|
# ── direnv ──────────────────────────────────────────────
|
|
if type -q direnv
|
|
direnv hook fish | source
|
|
end
|
|
|
|
# ── fzf ─────────────────────────────────────────────────
|
|
# fzf.fish plugin handles Ctrl+R (history) and Ctrl+F (files)
|
|
set -gx FZF_DEFAULT_OPTS "--height 40% --layout=reverse --border --info=inline"
|
|
|
|
# ── Zellij auto-attach ──────────────────────────────────
|
|
# Auto-attach to default session when opening a new Ghostty terminal
|
|
if test -z "$ZELLIJ" -a "$TERM" = "xterm-ghostty"
|
|
zellij attach --create default
|
|
end
|
|
|
|
# ── Aliases: files ──────────────────────────────────────
|
|
alias ls "eza --icons"
|
|
alias ll "eza -lah --icons"
|
|
alias lt "eza --tree --level=2 --icons"
|
|
alias cat "bat"
|
|
alias catp "bat --paging=always"
|
|
|
|
# ── Aliases: git ────────────────────────────────────────
|
|
alias gs "git status"
|
|
alias gd "git diff"
|
|
alias gl "git log --oneline -20"
|
|
alias gp "git pull"
|
|
|
|
# ── Aliases: docker ─────────────────────────────────────
|
|
alias dc "docker compose"
|
|
alias dps 'docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"'
|
|
alias dlog "docker logs -f"
|
|
alias dcup "docker compose up -d"
|
|
alias dcdown "docker compose down"
|
|
alias dlogs "docker compose logs -f"
|
|
|
|
# ── Aliases: ansible ────────────────────────────────────
|
|
alias ap "ansible-playbook"
|
|
alias av "ansible-vault"
|
|
|
|
# ── Aliases: python/uv ──────────────────────────────────
|
|
alias pysync "uv sync"
|
|
alias pyrun "uv run"
|
|
alias pyshell "uv run ipython"
|
|
|
|
# ── Aliases: clipboard ──────────────────────────────────
|
|
alias xc "xclip -selection clipboard"
|
|
|
|
# ── Aliases: misc ───────────────────────────────────────
|
|
alias fetch "fastfetch"
|
|
alias neofetch "fastfetch"
|
|
|
|
# ── Safety nets ─────────────────────────────────────────
|
|
alias rm "rm -i"
|
|
alias mv "mv -i"
|
|
alias cp "cp -i"
|
|
|
|
# ── Environment ─────────────────────────────────────────
|
|
set -gx EDITOR vim
|
|
set -gx VISUAL vim
|
|
set -gx COLORTERM truecolor
|
|
|
|
# Suppress Fish greeting
|
|
set -g fish_greeting
|
|
|
|
# ── System Info (login shells only) ─────────────────────
|
|
if status is-login
|
|
fastfetch
|
|
end
|
|
|
|
end
|
|
|
|
# ── Custom functions ────────────────────────────────────────
|
|
|
|
# Quick alias management (like addalias from zsh)
|
|
function addalias --description "Add a persistent alias"
|
|
set -l name $argv[1]
|
|
set -l cmd $argv[2..-1]
|
|
echo "alias $name \"$cmd\"" >> ~/.config/fish/conf.d/custom_aliases.fish
|
|
source ~/.config/fish/conf.d/custom_aliases.fish
|
|
echo "Added: $name"
|
|
end
|
|
|
|
function listalias --description "List custom aliases"
|
|
cat ~/.config/fish/conf.d/custom_aliases.fish 2>/dev/null; or echo "No custom aliases yet"
|
|
end
|