Skip to content
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
executable file 129 lines (99 sloc) 2.84 KB
#!/usr/bin/env bash
set -e
# macOS development setup
# Run this script to install and setup basic tools on a machine.
# Or run it to update current setup to latest changes.
# Steal the bits you like and adjust it to your needs.
# Run in dotfiles folder
cd -P "$(dirname "${BASH_SOURCE}")"
# Become super user before starting work
sudo -v
printf "\nSetting up system with latest toys ...\n\n"
# Enable italic support
tic xterm-256color-italic.terminfo
# Create folders
mkdir -p \
~/bin \
# Create Symlinks
link_to() {
if [ ! -e "$2" ]; then
if [ ! -e "$1" ]; then
printf "\nWARNING: cannot link $1 because it does not exist\n"
mkdir -p "$(dirname "$2")"
ln -s "$1" "$2"
printf "\nLinked $2"
link_dotfile() {
link_to $(pwd)/$1 ~/.$1
link_dotfile inputrc
link_dotfile bashrc
link_dotfile bash_profile
link_dotfile gitconfig
link_dotfile alacritty.yml
link_dotfile vimrc
link_dotfile psqlrc
link_dotfile sqliterc
link_to $(pwd)/nvim-client ~/bin/nvim-client
link_to ~/Dropbox/more/ssh/config ~/.ssh/config
link_to $(pwd)/deps.edn ~/.clojure/deps.edn
link_to "$(pwd)/Terminal" "/Applications/Terminal"
printf "\nUpdating macOS\n"
# sudo softwareupdate -i -a
if [[ "$(xcode-select -p)" == "" ]]; then
printf "\nInstalling Xcode\n"
xcode-select --install
# Brew
if ! command -v brew > /dev/null 2>&1; then
printf "\nInstalling Brew\n"
ruby -e "$(curl -fsSL"
brew analytics off
printf "\nUpdating Brew\n"
brew update
brew upgrade
printf "\nInstalling Brew taps\n"
comm -23 <(sort brew.txt) <(brew leaves) | xargs brew install
# Update brew.txt
brew leaves > brew.txt
printf "\nInstalling Cask taps\n"
comm -23 <(sort cask.txt) <(brew cask ls) | xargs brew cask install
# Update brew.txt
brew cask ls > cask.txt
brew cleanup
# FZF - Install key bindings and fuzzy completion
$(brew --prefix)/opt/fzf/install \
--no-zsh \
--no-update-rc \
--key-bindings \
# NPM packages
printf "\nUpdating npm packages\n"
cat npm.txt | xargs npm i -g
ls /usr/local/lib/node_modules > npm.txt
# Neovim
pip install --upgrade pip
pip3 install --upgrade pip
pip3 install --user --upgrade neovim
pip install --user --upgrade neovim
test -d ~/.vim || mkdir ~/.vim
if [ ! -d ~/.config/nvim ]; then
ln -s ~/.vim ~/.config/nvim
ln -s ~/.vimrc ~/.config/nvim/init.vim
ln -s /usr/share/vim/vim74/spell/ ~/.config/nvim/
printf "\nLinked Neovim config"
# vim-plug
if [ ! -e ~/.config/nvim/autoload/plug.vim ]; then
printf "\nInstalling vim-plug"
curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \
nvim +PlugInstall +PlugUpgrade +PlugUpdate +PlugClean! +UpdateRemotePlugins +qall
printf "\n\n\nAll good. Enjoy your day human.\n"