Browse Source

Add automatic install of zsh syntax highlighting

master
Taylor Bockman 2 years ago
parent
commit
aa4af08e18
  1. 18
      dotfiles/zsh/zshrc

18
dotfiles/zsh/zshrc

@ -50,14 +50,27 @@ fi
if [[ ! -d $HOME/.zsh ]]; then if [[ ! -d $HOME/.zsh ]]; then
echo "Installing zsh git completion scripts" echo "Installing zsh git completion scripts"
mkdir -p $HOME/.zsh mkdir -p $HOME/.zsh
pushd
cd $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-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 curl -o _git https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.zsh
cd $HOME popd
fi fi
# Install zsh-syntax-highlighting if it doesn't exist
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
zstyle ':completion:*:*:git:*' script $HOME/.zsh/git-completion.bash zstyle ':completion:*:*:git:*' script $HOME/.zsh/git-completion.bash
fpath=(~/.zsh $fpath) fpath=(~/.zsh $fpath)
@ -71,5 +84,8 @@ source $symlink_dir/exports.zsh
source $symlink_dir/initializations.zsh source $symlink_dir/initializations.zsh
source $symlink_dir/ps1.zsh source $symlink_dir/ps1.zsh
# ZSH syntax highlighting must be sourced last
source $HOME/.zsh/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
# ------------------------------ END SETUP ------------------------------ # # ------------------------------ END SETUP ------------------------------ #

Loading…
Cancel
Save