macOS Init Guide

homebrew

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

homebrew source

cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

brew update
brew install caskroom/cask/brew-cask 

iTerm 2

brew cask install iterm2

zsh

brew install zsh zsh-completions

OhMyZsh

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

zsh-sytax-highlighting

brew install zsh-syntax-highlighting
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

powerline

# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts

sublime text 3

brew cask install sublime-text
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl

autojump

brew install autojump

然后将下面这段代码加入 shell 的配置文件中,比如.bashrc.zhsrc 中.

[ -f /usr/local/etc/profile.d/autojump.sh ] && . /usr/local/etc/profile.d/autojump.sh

nvm (Node.js 环境管理)

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
nvm install node
nvm use node

nrm(Node.js Mirro 管理)

npm install nrm -g --save
nrm use taobao

PyEnv(Python 环境管理)

curl https://pyenv.run | bash
Pyenv install 3.7.3
export PATH="/Users/bestony/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"

rbEnv

brew install rbenv
eval "$(rbenv init -)"

常用软件

brew cask install 1password sublime-text google-chrome

发表评论