Skip to content

Instantly share code, notes, and snippets.

@instance-id
Last active May 8, 2019 01:12
Show Gist options
  • Save instance-id/6c3d56be3e43225a2f91ddcc8900d5fd to your computer and use it in GitHub Desktop.
Save instance-id/6c3d56be3e43225a2f91ddcc8900d5fd to your computer and use it in GitHub Desktop.
zshrc
#!/bin/zsh
check_command() {
command -v $1 > /dev/null 2>&1
}
export ZSH=$HOME/.oh-my-zsh
# // --- Different settings for SSH ------------
if [[ -n $SSH_CONNECTION ]]; then
ZSH_THEME='af-magic'
export EDITOR='micro'
else
ZSH_THEME='af-magic'
export EDITOR='micro'
fi
# // --- For updating oh-my-zsh plugins---------
if check_command antibody && [ -f $HOME/.zsh_plugins.txt ]; then
if [ -f $HOME/.zsh_plugins.sh ]; then
source $HOME/.zsh_plugins.sh
else
echo "Initializing antibody"
antibody bundle < $HOME/.zsh_plugins.txt > $HOME/.zsh_plugins.sh
fi
fi
source $ZSH/oh-my-zsh.sh
# // --- Completion ----------------------------
fpath=($fpath ~/.zsh/completion)
autoload -U compinit && compinit
if [[ -n ~/.zcompdump(#qN.mh+24) ]]; then
compinit;
else
compinit -C;
fi
# // --- Load all files in ~/.zshrc.d/ ---------
for i in ~/.zshrc.d/* ; do
if [ -r "$i" ]; then
source $i
fi
done
# // --- Move cursor to bottom -----------------
tput cup 9999 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment