status is-login; and replay "source /etc/profile"
{# 0022 is the default, so don't do anything in that case #}
{% if not umask in ['0022', '022'] %}
status is-login; and umask {{ umask }}
{% endif %}

# PATH
set -gx fish_user_paths $XDG_BIN_HOME $CARGO_HOME/bin $GOPATH/bin $NPM_CONFIG_PREFIX/bin

# Starship prompt
if command -v starship > /dev/null
  starship init fish --print-full-init | source
end

# zoxide
if command -v zoxide >/dev/null
  zoxide init fish | source
end

# direnv
if command -v direnv > /dev/null
  direnv hook fish | source
  # set -g direnv_fish_mode eval_after_arrow
end

# vi key bindings
fish_vi_key_bindings

# fzf key bindings
status is-interactive; and fzf_key_bindings

# gpg-agent
set -gx GPG_TTY (tty)
{% if not dropbear_ssh_client %}
# gpg-agent normally starts on demand but ssh command doesn't trigger it
# As such manually start it on login
status is-login; and gpg-connect-agent /bye >/dev/null
gpg-connect-agent updatestartuptty /bye >/dev/null
if test -z "$SSH_AUTH_SOCK"
  set -gx SSH_AUTH_SOCK (gpgconf --list-dirs agent-ssh-socket)
end
{% endif %}
