Files
dotfiles/home/dot_config/fish/config.fish.tmpl

57 lines
1.7 KiB
Cheetah

# Fish shell configuration
# Managed by chezmoi
# Disable greeting
set -g fish_greeting
{{- if .wsl }}
if status is-login
and status is-interactive
keychain --quiet --agents ssh --eval ~/.ssh/id_rsa | source
end
{{- end }}
# Common shared configuration (environment variables, PATH, tool setup)
{{ template "scripts/commonrc.fish.tmpl" dict "data" . }}
# Chezmoi shell completion
{{ completion "fish" }}
# VS Code / Cursor shell integration
if test "$TERM_PROGRAM" = "vscode"
if command -q code
string replace -r '^' '' (code --locate-shell-integration-path fish) | source
else if command -q cursor
string replace -r '^' '' (cursor --locate-shell-integration-path fish) | source
end
end
# fzf.fish configuration (PatrickF1/fzf.fish via Fisher)
if functions -q fzf_configure_bindings
# Remap CTRL+V (variables) to Alt+Ctrl+V to avoid paste conflict
# Disable history (--history=) to let Atuin keep CTRL+R
fzf_configure_bindings --variables=\e\cv --history=
# Always include hidden files (dotfiles) in searches
set -g fzf_fd_opts --hidden
# Directory search: Ctrl+I toggles gitignored files
set -g fzf_directory_opts \
--header 'C-i: toggle ignored' \
--bind 'ctrl-i:reload(fd --type f --hidden --no-ignore)+change-prompt(+ignored > )'
end
# Load custom functions from ~/.config/fish/functions/
# (Fish does this automatically, no explicit sourcing needed)
# Custom keybindings
if functions -q fzf_search_abbr
bind \ea fzf_search_abbr # Alt+A: Search abbreviations/aliases
bind -M insert \ea fzf_search_abbr # Also bind in insert mode
end
# Load abbreviations
if test -f ~/.config/fish/conf.d/abbr.fish
source ~/.config/fish/conf.d/abbr.fish
end