if [[ $(uname) != "Darwin" ]]; then
	if [ -z "${WAYLAND_DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
		dbus-run-session sway
	fi
	bindkey "^[[1;5C" forward-word
	bindkey "^[[1;5D" backward-word
	bindkey "^[[3~" delete-char
	bindkey "^[[5~" up-line
	bindkey "^[[6~" down-line
fi

HISTFILE=~/.zsh_history
HISTSIZE=100
SAVEHIST=200

source "$HOME/.local/share/zinit/zinit.git/zinit.zsh"

zinit light zsh-users/zsh-autosuggestions
zinit light zdharma-continuum/fast-syntax-highlighting
if [[ $(uname) == "Darwin" ]]; then
	zinit light junegunn/fzf
fi

eval "$(starship init zsh)"
eval "$(zoxide init --cmd cd zsh)"

autoload -Uz _zinit
(( ${+_comps} )) && _comps[zinit]=_zinit

export PATH="$HOME/.local/bin:$PATH"

create-repo() {
    printf "Repo name: "
    read -r name || return

    [ -z "$name" ] && { echo "No name given"; return; }

    remote_path="hub/$name.git"

    ssh git "
        mkdir -p '/home/git/$remote_path' &&
        git init --bare '/home/git/$remote_path' &&
	cp '/home/git/hub/dotfiles.git/hooks/post-receive' '/home/git/$remote_path/hooks/'
    " && echo "Created git:$remote_path"
    ssh git set-desc "$name.git" "$desc"
}

alias ls="ls -a --color"
alias grep="rg"
if [[ $(uname) != "Darwin" ]]; then
	alias update_world='doas emerge --ask --update --newuse --deep @world'
	alias env="sh /home/andrew/personal/dotfiles/env_linux.sh"
	myfetch.sh
else
	alias env='sh ~/personal/dotfiles/env_mac.sh'
	export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
	export PATH="$(brew --prefix llvm)/bin:$PATH"
	export GOOGLE_CLOUD_PROJECT="development-477121"
fi
