My V2 zsh configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
2.6 KiB

#!/bin/zsh
if [[ "$OSTYPE" == "linux-gnu" ]]; then
symlink_dir=$(cd "$( dirname "`readlink -f ${(%):-%N}`" )" && pwd)
else
# OS X is not a fan of `readlink -f`
symlink_dir=$(cd "$( dirname "`readlink ${(%):-%N}`" )" && pwd)
fi
# Store private information (exports, keys, etc) in .bash_private.
if [[ -f $HOME/.bash_private ]]; then
source $HOME/.bash_private
fi
# Or alternatively .private...
if [[ -f $HOME/.private ]]; then
source $HOME/.private
fi
# Or alternatively .zsh_private...
if [[ -f $HOME/.zsh_private ]]; then
source $HOME/.zsh_private
fi
if [ -f $HOME/.inputrc ]; then
source $HOME/.inputrc
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ -f $HOME/.macrc ]; then
source $HOME/.macrc
fi
fi
# Set up projects and gopath folder properly for the export in the export section.
if [[ ! -d $HOME/projects ]]; then
echo "Making $HOME/projects"
mkdir -p $HOME/projects
fi
if [[ -x go ]]; then
echo "Making $HOME/.go"
mkdir -p $HOME/.go
fi
# Install zsh completion in ~/.zsh if it doesn't exist
if [[ ! -d $HOME/.zsh ]]; then
echo "Installing zsh git completion scripts"
mkdir -p $HOME/.zsh
pushd
cd $HOME/.zsh
curl -o git-completion.bash https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
curl -o _git https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh
popd
fi
autoload -U is-at-least
# Install zsh-syntax-highlighting if it doesn't exist
if is-at-least 4.3.11; then
if [[ ! -d $HOME/.zsh/zsh-syntax-highlighting ]]; then
echo "Installing zsh syntax highlighting"
pushd
cd $HOME/.zsh
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
popd
fi
else
echo "ZSH syntax highlighting requires ZSH >= 4.3.11 (current: $ZSH_VERSION)."
fi
zstyle ':completion:*:*:git:*' script $HOME/.zsh/git-completion.bash
fpath=(~/.zsh $fpath)
autoload -Uz compinit && compinit
# Pull in other configurations
source $symlink_dir/aliases.zsh
source $symlink_dir/functions.zsh
source $symlink_dir/exports.zsh
source $symlink_dir/initializations.zsh
source $symlink_dir/ps1.zsh
source $symlink_dir/keybinds.zsh
# ZSH syntax highlighting must be sourced last
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# Created by `userpath` on 2022-09-05 23:32:41
export PATH="$PATH:$HOME/.local/bin"
# ghcup config - Haskell
[ -f "/home/taylor/.ghcup/env" ] && source "/home/taylor/.ghcup/env" # ghcup-env
# Ocaml
test -r $HOME/.opam/opam-init/init.sh && . $HOME/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
# Rust
if [ -f "$HOME/.cargo/env" ]; then
. "$HOME/.cargo/env"
fi