caelestia/fish/config.fish
2026-01-06 16:58:34 +00:00

62 lines
1.5 KiB
Fish

if status is-interactive
set -e SSH_AUTH_SOCK
set -U -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
set -x GPG_TTY (tty)
gpgconf --launch gpg-agent
set -gx EDITOR /usr/bin/hx
# Starship custom prompt
starship init fish | source
# Direnv + Zoxide
command -v direnv &>/dev/null && direnv hook fish | source
command -v zoxide &>/dev/null && zoxide init fish --cmd cd | source
# Better ls
alias ls='eza --icons --group-directories-first -1'
# Abbrs
abbr lg lazygit
abbr gd 'git diff'
abbr ga 'git add .'
abbr gc 'git commit -am'
abbr gl 'git log'
abbr gs 'git status'
abbr gst 'git stash'
abbr gsp 'git stash pop'
abbr gp 'git push'
abbr gpl 'git pull'
abbr gsw 'git switch'
abbr gsm 'git switch main'
abbr gb 'git branch'
abbr gbd 'git branch -d'
abbr gco 'git checkout'
abbr gsh 'git show'
abbr l ls
abbr ll 'ls -l'
abbr la 'ls -a'
abbr lla 'ls -la'
# Custom colours
#cat ~/.local/state/caelestia/sequences.txt 2>/dev/null
# For jumping between prompts in foot terminal
function mark_prompt_start --on-event fish_prompt
echo -en "\e]133;A\e\\"
end
function y
set tmp (mktemp -t "yazi-cwd.XXXXXX")
yazi $argv --cwd-file="$tmp"
if read -z cwd <"$tmp"; and [ -n "$cwd" ]; and [ "$cwd" != "$PWD" ]
builtin cd -- "$cwd"
end
rm -f -- "$tmp"
end
bind \cz 'fg 2>/dev/null; commandline -f repaint'
end