Skip to content

Instantly share code, notes, and snippets.

@georgiyordanov
Forked from angelyordanov/osx_setup.md
Last active June 14, 2024 07:57
Show Gist options
  • Save georgiyordanov/c205f161c74aa1316258af7bcac10821 to your computer and use it in GitHub Desktop.
Save georgiyordanov/c205f161c74aa1316258af7bcac10821 to your computer and use it in GitHub Desktop.
Mac OS X setup

Setup Mac OS X

Setup

1. Before setup

Make sure everything is up to date. Wait for FileVault to finish encrypting the hard drive.

2. Install homebrew and other CLI tools

http://brew.sh/

# install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | zsh
source ~/.zshrc

# install node
nvm install node

# install pyenv
brew install pyenv

# add pyenv init to ZSH
echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n  eval "$(pyenv init -)"\nfi' >> ~/.zshrc

# setup suggested build environment for pyenv
brew install openssl readline sqlite3 xz zlib

# check latest verion
pyenv install --list

# install latest verion
pyenv install 3.9.4

# set the latest verion as the global default
pyenv global 3.9.4

# install mssql-cli
pip install mssql-cli

# install vim-plug
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim

# copy .vimrc to ~
# in vim run :PlugInstall

# install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

# copy .zshrc and .zshenv to ~

3. Install software

homebrew

brew install git
brew install mas # Mac App Store command line interface
brew install openfortivpn
brew install vim
brew install youtube-dl

# install mssql-tools
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
HOMEBREW_NO_ENV_FILTERING=1 ACCEPT_EULA=y brew install mssql-tools

homebrew-cask

# essential
brew install --cask dropbox
brew install --cask google-drive
brew install --cask microsoft-office # onedrive included
brew install --cask 1password
brew install --cask google-chrome
brew install --cask firefox
brew install --cask brave-browser
brew install --cask tripmode
brew install --cask spectacle
brew install --cask coconutbattery
brew install --cask mpv
brew install --cask qbittorrent
brew install --cask microsoft-teams
brew install --cask messenger
#brew install --cask slack

# utils
brew install --cask the-unarchiver
brew install --cask daisydisk
brew install --cask intel-power-gadget

# dev
brew install --cask sourcetree
brew install --cask visual-studio-code
brew install --cask azure-data-studio
brew install --cask docker

# others
brew install --cask skype
brew install --cask gimp

App Store

mas install 1295203466 # Microsoft Remote Desktop
mas install 937984704 # Amphetamine

Manually install

  • dotnet
  • Chrome Canary
  • Firefox 68 ESR

4. Borrow a few OSX settings from mathiasbynens dotfiles

###############################################################################
# General                                                                     #
###############################################################################

# Disable automatic capitalization as it’s annoying when typing code
defaults write NSGlobalDomain NSAutomaticCapitalizationEnabled -bool false

# Disable smart dashes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticDashSubstitutionEnabled -bool false

# Disable automatic period substitution as it’s annoying when typing code
defaults write NSGlobalDomain NSAutomaticPeriodSubstitutionEnabled -bool false

# Disable smart quotes as they’re annoying when typing code
defaults write NSGlobalDomain NSAutomaticQuoteSubstitutionEnabled -bool false

# Disable auto-correct
defaults write NSGlobalDomain NSAutomaticSpellingCorrectionEnabled -bool false

###############################################################################
# System preferences                                                          #
###############################################################################

# Move dock to left
defaults write com.apple.dock orientation left

# Trackpad: enable tap to click for this user and for the login screen
defaults write com.apple.driver.AppleBluetoothMultitouch.trackpad Clicking -bool true
defaults -currentHost write NSGlobalDomain com.apple.mouse.tapBehavior -int 1
defaults write NSGlobalDomain com.apple.mouse.tapBehavior -int 1

# Require password immediately after sleep or screen saver begins
defaults write com.apple.screensaver askForPassword -int 1
defaults write com.apple.screensaver askForPasswordDelay -int 0

# Use function keys
defaults write -g com.apple.keyboard.fnState -bool true

###############################################################################
# Finder                                                                      #
###############################################################################

# Finder: show hidden files by default
defaults write com.apple.finder AppleShowAllFiles -bool true

# Finder: show all filename extensions
defaults write NSGlobalDomain AppleShowAllExtensions -bool true

# Finder: show status bar
defaults write com.apple.finder ShowStatusBar -bool true

# Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true

# Disable the warning when changing a file extension
defaults write com.apple.finder FXEnableExtensionChangeWarning -bool false

# Avoid creating .DS_Store files on network or USB volumes
defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true

# Use list view in all Finder windows by default
# Four-letter codes for the other view modes: `icnv`, `clmv`, `glyv`
defaults write com.apple.finder FXPreferredViewStyle -string "Nlsv"

# Show the ~/Library folder
chflags nohidden ~/Library && xattr -d com.apple.FinderInfo ~/Library

# Show the /Volumes folder
sudo chflags nohidden /Volumes

###############################################################################
# Address Book, Dashboard, iCal, TextEdit, and Disk Utility                   #
###############################################################################

# Use plain text mode for new TextEdit documents
defaults write com.apple.TextEdit RichText -int 0

# Open and save files as UTF-8 in TextEdit
defaults write com.apple.TextEdit PlainTextEncoding -int 4
defaults write com.apple.TextEdit PlainTextEncodingForWrite -int 4

source: https://github.com/mathiasbynens/dotfiles/blob/master/.macos

5. Create/Update ~/.gitconfig

git config --global user.name "Georgi Yordanov"
git config --global user.email [email protected]
git config --global merge.conflictstyle diff3
git config --global alias.stashu 'stash -u'
git config --global rerere.enabled true
git maintenance start
git config --global maintenance.prefetch.enabled false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment