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.
75 lines
1.8 KiB
75 lines
1.8 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 |
|
|
|
# -------------------------------- SETUP -------------------------------- # |
|
|
|
# Store private information (exports, keys, etc) in .bash_private. |
|
if [[ -f $HOME/.bash_private ]]; then |
|
source $HOME/.bash_private |
|
echo ".bash_private loaded" |
|
fi |
|
|
|
# Or alternatively .private... |
|
if [[ -f $HOME/.private ]]; then |
|
source $HOME/.private |
|
echo ".private loaded" |
|
fi |
|
|
|
if [ -f $HOME/.inputrc ]; then |
|
source $HOME/.inputrc |
|
else |
|
echo "No .inputrc detected" |
|
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 |
|
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 |
|
|
|
cd $HOME |
|
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 |
|
|
|
# ------------------------------ END SETUP ------------------------------ # |
|
|
|
|