Skip to content

Instantly share code, notes, and snippets.

@pzelasko
Last active April 22, 2021 14:48
Show Gist options
  • Save pzelasko/a9c56b9152df4b2991ae0b1c8731cf53 to your computer and use it in GitHub Desktop.
Save pzelasko/a9c56b9152df4b2991ae0b1c8731cf53 to your computer and use it in GitHub Desktop.
Set up a server with ZSH
#!/bin/bash
# default zsh
#sudo chsh -s /bin/zsh pzelasko
# oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# syntax checker
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
# autosuggestions
git clone https://github.com/zsh-users/zsh-autosuggestions "${HOME}/.oh-my-zsh/custom/plugins/zsh-autosuggestions"
# enable plugins
sed -i 's/plugins=(git)/plugins=(git zsh-syntax-highlighting zsh-autosuggestions)/' "${HOME}/.zshrc"
echo "pasteinit() {" >> ~/.zshrc
echo ' OLD_SELF_INSERT=${${(s.:.)widgets[self-insert]}[2,3]}' >> ~/.zshrc
echo " zle -N self-insert url-quote-magic" >> ~/.zshrc
echo "}" >> ~/.zshrc
echo "" >> ~/.zshrc
echo "pastefinish() {" >> ~/.zshrc
echo ' zle -N self-insert $OLD_SELF_INSERT' >> ~/.zshrc
echo "}" >> ~/.zshrc
echo "zstyle :bracketed-paste-magic paste-init pasteinit" >> ~/.zshrc
echo "zstyle :bracketed-paste-magic paste-finish pastefinish" >> ~/.zshrc
# useful env vars
echo "export PIPENV_TIMEOUT=3600" >> "${HOME}/.zshrc"
# enable colors!
git config --global color.ui auto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment