macOS 套件的管理工具
xcode-select --install
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
用 brew cask
來安裝應用程式要先執行:
brew install cask
or
brew tap caskroom/cask
用 homebrew 安裝字型要先執行:
brew tap caskroom/fonts
brew install git
brew install vim tmux zsh
brew cask install iterm2
brew install wget
iTerm2 setup color: iTerm2-Color-Schemes
eg. download Tomorrow-Night-Bright (save at projects/iTerm2-Color-Schemes/schemes/):
wget -O "Tomorrow Night Bright.itermcolors" https://raw.githubusercontent.com/mbadolato/iTerm2-Color-Schemes/master/schemes/Tomorrow%20Night%20Bright.itermcolors
then import it.
Set zsh to be iTerm2 default shell:
a. Go to iTerm2 preferences.
b. Head to Profiles -> General.
c. Paste /bin/zsh in the Command textbox and restart iTerm2.
powerline是一個python套件
5.1. Install powerline-status
pip install powerline-status
.bash_profile 設定加入(python路徑可能不一樣):
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /usr/local/lib/python3.6/site-packages/powerline/bindings/bash/powerline.sh
my settings:
powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
. /anaconda3/lib/python3.6/site-packages/powerline/bindings/bash/powerline.sh
5.2. font setup:
# clone
git clone https://github.com/powerline/fonts.git --depth=1
# install
cd fonts
./install.sh
# clean-up a bit
cd ..
rm -rf fonts
再去terminal設定那邊更改字型
5.3. To show gitstatus: ref
pip install powerline-gitstatus
my powerline-install-directory: /anaconda3/lib/python3.6/site-packages/
add some lines into:
${powerline-install-directory}/powerline/config_files/colorschemes/shell/default.json
add the following lines into
${powerline-install-directory}/powerline/config_files/themes/shell/default.json
:
{
"function": "powerline_gitstatus.gitstatus",
"priority": 40
}
after edit above, save the file and run the following:
powerline-daemon —-replace
in the Terminal.
5.4. vim setup:
add follow lines to .vimrc
:
set rtp+={powerline-install-directory}/powerline/bindings/vim/
set laststatus=2
set t_Co=256
5.5. tmux setup:
add follow line to .tmux.conf
:
source '{powerline-install-directory}/powerline/bindings/tmux/powerline.conf'
5.6. zsh setup:
add follow line to .zshrc
:
{powerline-install-directory}/powerline/bindings/zsh/powerline.zsh