## PATH

fish_add_path ~/.local/bin
fish_add_path ~/.go/bin
fish_add_path ~/.npm/bin
fish_add_path ~/.local/share/gem/ruby/3.0.0/bin

## SSH init
set -x SSH_AUTH_SOCK $XDG_RUNTIME_DIR/ssh-agent.socket
for f in (ls $HOME/.ssh/*.pub);
  set -l priv (string replace '.pub' '' $f);
  if not contains $priv (ssh-add -l | awk '{ print $3 }')
    ssh-add $priv >/dev/null 2>&1
  end
end

# Start X at login
if status is-login
  if test -z "$DISPLAY" -a "$XDG_VTNR" = 1 -a -z "$TMUX"
    exec startx -- -keeptty
  end
end

set -x GOPATH ~/.go
set -x EDITOR nvim

