Skip to content

Instantly share code, notes, and snippets.

@espoelstra
Last active April 27, 2020 01:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save espoelstra/44a4981493aeb659ce5c5925da14432f to your computer and use it in GitHub Desktop.
Save espoelstra/44a4981493aeb659ce5c5925da14432f to your computer and use it in GitHub Desktop.
New macOS setup for flexibility and productivity
# Check the dock settings
# Future plan is automatic removal of unwanted items and addition of only necessary items using dockutil/Ansible
# plutil -p Library/Preferences/com.apple.dock.plist
# Enable SSH server for remote management/configuration
sudo systemsetup -setremotelogin on
# Install Homebrew (if it isn't already available)
hash brew || /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install iterm2
brew cask install karabiner-elements
# https://github.com/rux616/karabiner-windows-mode
open 'karabiner://karabiner/assets/complex_modifications/import?url=https://raw.githubusercontent.com/rux616/karabiner-windows-mode/master/windows_shortcuts.json'
# for Tabs Outliner so Ctrl+x and Ctrl+Shift+x are consistent across Windows/macOS/ChromeOS
open 'karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/espoelstra/53c747a274a7b2b81652ab1cd74a13da/raw/tabs_outliner.json'
# for macOS in a VM where host already remaps Caps to Esc
open 'karabiner://karabiner/assets/complex_modifications/import?url=https://gist.githubusercontent.com/espoelstra/7457c97a09d966e4cb62c6bc406b0422/raw/esc_ctrl.json'
# letting brew touch anything python is a recipe for trouble
#brew install pyenv pyenv-virtualenv
#brew install pipx
curl -L https://pyenv.run | bash
# Setup profile to make pyenv available everywhere
echo ‘if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi’ >> ~/.bash_profile
echo ‘if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi’ >> ~/.bash_profile
pyenv install 3.6.8 && \
pyenv install 2.7.16 && \
pyenv global 3.6.8 2.7.16
: <<-'EOC'
# Need to modify the Formula to enable clipboard
brew edit vim
# Add `"--enable-clipboard",` to middle of formula
brew install -s vim
EOC
# Alternative to editing vim Formula to fix clipboard is to use `neovim`
brew install neovim
# Maybe just 'brew link neovim' ?
#ln -s $(which nvim) /usr/local/bin/vim
#ln -s $(which nvim) /usr/local/bin/vi
brew link neovim
echo "EDITOR=nvim" >> ~/.bash_profile
# Standard communications tools
brew cask install teams slack
brew cask install google-chrome
# Keep in Dock:
# Finder
# Terminal
# Google Chrome
# App Store
# Settings
# brew install dockutil
# There is a slick Ansible playbook for using dockutil to manage the list declaratively
# See also: https://github.com/ryangball/DockBuilder
# Used for Yubikey as SSH and gopass encrypted secrets
brew install gnupg
brew install pinentry-mac
: << EOC
# pip install nodeenv actually provides better separation if you use it properly
# Needed to manage Node versions better for most projects
brew install nvm
mkdir ~/.nvm
cat <<-'EOF' >> ~/.bash_profile
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion" ] && . "/usr/local/opt/nvm/etc/bash_completion" # This loads nvm bash_completion
EOF
EOC
# other misc tools and IDEs
brew cask install visual-studio-code
@espoelstra
Copy link
Author

I have considered refactoring into a Brewfile and the shell script, but I think a Brewfile install would happen after the script runs just to "lock" the list of packages and then allow for easier upgrades across all the packages, but with all the specific configuration that happens after certain packages using inline installation in the script and immediate configuration is probably the best route for most things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment