dotfiles/dot_config/fish/config.fish.tmpl

40 lines
1 KiB
Cheetah

if status is-interactive
# Fix for terminals without terminfo on server (e.g., Ghostty)
if not test -e /usr/share/terminfo/$TERM[1]/$TERM
set -gx TERM xterm-256color
end
# Disable OSC 133 shell integration
functions -e __fish_on_interactive_startup_done
functions -e __fish_prompt_initialized
end
# Clear screen AND scrollback with Ctrl+L
bind \cl 'printf "\e[2J\e[3J\e[H"; commandline -f repaint'
# PATH setup
fish_add_path -g ~/.local/bin
{{- if eq .machine "macbook" }}
# macOS-specific: Homebrew paths
fish_add_path -g /opt/homebrew/bin
fish_add_path -g /opt/homebrew/sbin
{{- end }}
{{- if eq .machine "server" }}
# Server-specific: SSH key caching and Helix runtime
keychain --eval --quiet id_ed25519 | source
set -gx HELIX_RUNTIME /usr/local/lib/helix/runtime
{{- end }}
{{- if ne .machine "macbook" }}
# SSH agent socket (systemd user service)
set -gx SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
{{- end }}
# GPG TTY for signing
set -gx GPG_TTY (tty)
# Editor
set -gx EDITOR {{ .editor }}
set -gx VISUAL {{ .editor }}