[Mac] 開發環境建構 2022.Aug
last updated: 2021-02-26T14:53:37+08:00
過去重灌電腦最麻煩的就是還原設定檔, 雖然 Mac 有 TimeMachine 可無痛轉移, 但個人癖好還是喜歡重新檢視與安裝設定. 但越來越多軟體可以把配置設定存在雲端, 不但保持多台電腦間的同步, 重灌也只需登入帳號就可還原配置, 個人以為比 TimeMachine 方便.
但仍有些開發或 CLI 工具, 是將配置檔存放於家目錄下的隱藏檔 (.files), 無法透過雲端同步. 我是把這些檔案搬移到 Dropbox 資料夾下, 再建立 Symbolic Link, 如此就可透過 Dropbox 來同步設定檔.
現在重灌電腦要安裝設定環境, 僅需透過 shell script 安裝軟體與建立 Symbolic Link, 相當無痛.
CLI Environment
iTerm2
brew install iterm2
zsh and oh-my-zsh
macOS Mojave (10.14.x) 開始內建 zsh, 而 Catalina (10.15.x) 以後預設 Shell 改為 zsh.
在 macOS Mojave 系統要把預設 shell 改為 zsh 以及配置 zsh 最方便也推薦的方式就是透過 Oh My Zsh
Oh My Zsh
macOS Mojave 以後已經內建 Zsh, 所以直接安裝 Oh My Zsh 即可.
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
brew install zsh-completion
Powerline Font
brew tap homebrew/cask-fonts
brew install font-fira-code font-fira-mono font-fira-sans
brew install font-source-code-pro
brew install font-hack-nerd-font
Base Environment
Docker
brew install docker
Brew formulae
brew install git tig zsh-completion tmux ncdu htop lesspipe sshtrix tldr diff-so-fancy fd ripgrep rclone thefuck ag svn moreutils asdf
Program Language
Node.js
Installing Node.js or io.js with nvm
NVM Manual install
git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
cat ". ~/.nvm/nvm.sh" >> .bashrc
Install node.js
nvm install v8.11.1
nvm alias default tls
nvm use default
Go
brew install go
Dart
brew tap dart-lang/dart
brew install dart
IDE & GUI Tools
VSCode
brew install --cask visual-studio-code
GoLand
brew install --cask goland
WebStorm
brew install --cask webstorm
Others
Fork - a fast and friendly git client for Mac
brew install fork
Postman
The Collaboration Platform for API Development.
brew install postman
Sequel Pro is a fast, easy-to-use Mac database management application for working with MySQL databases.
brew install sequel-pro
Modern, Native Tool for Database Management.
brew install tableplus
Redis GUI management tool for Windows, Mac OS X, Ubuntu and Debian.
brew install --cask another-redis-desktop-manager
Robo 3T. Free, open-source MongoDB GUI
brew install tableplus