if test -f $HOME/.local/bin/mise
    $HOME/.local/bin/mise activate fish | source
end

if status is-interactive
    set -g fish_key_bindings fish_vi_key_bindings

    if command -q starship
        starship init fish | source
    else if test -x /opt/homebrew/bin/starship
        /opt/homebrew/bin/starship init fish | source
    else if test -x /usr/local/bin/starship
        /usr/local/bin/starship init fish | source
    end

    # Start or re-use a gpg-agent.
    gpgconf --launch gpg-agent

    # Ensure that GPG Agent is used as the SSH agent
    set -e SSH_AUTH_SOCK
    set -U -x SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
end

set -U fish_greeting

abbr lzg lazygit
abbr lzd lazydocker
abbr hist "history | fzf | fish_clipboard_copy"

if test -f "$HOME/.config/fish/local.fish"
 source "$HOME/.config/fish/local.fish"
end

fish_add_path -g ~/bin
fish_add_path -g ~/.local/bin
