Mac のセットアップ

前半が初期設定(doc/MAC_SETUP.md)、後半が OS アップデート後にやること(doc/MAC_UPDATE.md)。

初期設定

OSアップデート

  • About This Mac -> Software Update

言語

  • English(US)にする

キーボード

  • Key Repeat -> Fast
  • Delay Until Repeat -> Short

キーボードのショートカット

  • Keyboard Shortcuts -> Show Launchpad -> Command + L
  • Keyboard Shortcuts -> Spotlight -> Show Spotlight searchのチェックを外す
  • Keyboard Shortcuts -> Input Sources -> Select the previous input source -> Command + Space
  • Keyboard Shortcuts -> Modifier Keys -> Caps Lock Key -> Control

Dockを精査

  • 残すもの: Finder, Launchpad, System Preferences
  • Terminalを追加

拡張子を表示する

  • defaults write NSGlobalDomain AppleShowAllExtensions -bool true

.DS_Storeを作らない

  • defaults write com.apple.desktopservices DSDontWriteNetworkStores -bool true
  • defaults write com.apple.desktopservices DSDontWriteLocalStores -bool true

Finder

  • defaults write com.apple.finder NewWindowTargetPath -string “file://${HOME}”
  • defaults write com.apple.finder AppleShowAllFiles -bool true
  • defaults write com.apple.finder _FXShowPosixPathInTitle -bool true
  • defaults write com.apple.finder ShowStatusBar -bool true
  • defaults write com.apple.finder ShowPathbar -bool true

インストール

  • Chrome
  • Docker
  • Sublime
  • Sequel Ace
  • pgAdmin

Homebrew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo >> ~/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
  • git
brew install git
brew install rbenv
rbenv init
source ~/.zprofile
 
rbenv install -l
rbenv install 3.4.2
rbenv global 3.4.2
 
rbenv exec gem install bundler
gem update --system
 
echo 'gem: --no-ri --no-rdoc' >> ~/.gemrc
  • node関連
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
source ~/.zprofile
 
nvm install --lts --default
  • DB関連
# Dockerだけでもローカルのクライアントが必要な場合がある
brew install postgresql
brew install mysql

Sublime

vim

  • vim を参照

OS アップデート後にやること

Developer Tools

  • About This Mac -> Software Update -> Developer Toolsをアップデート(コマンドラインよりも新しいものがインストールされる)

homebrew

  • brew update
  • brew upgrade
  • brew cleanup
  • brew doctor

rbenv

  • cd ~/.rbenv/plugins/ruby-build && git pull
  • rbenv install -l

nvm

  • nvm install —lts
  • npm i -g npm && npm -v
  • npm ls
  • npm ls -g
  • npm outdated && npm outdated -g
  • npm update && npm update -g
  • npm cache verify
  • npm doctor && npm doctor -g
  • npm audit

以下は.zshrc等に記載

nvm alias default lts/*
nvm use --lts