iTerm2 設定(Mac Only)

安裝 iTerm2

https://www.iterm2.com/


啟用 zsh

  1. 輸入 chsh -s /bin/zsh

安裝使用 oh-my-zsh

  1. cd ~/
  2. git clone git://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
  3. cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
  4. cp ~/.zshrc ~/.zshrc.orig

修改 ~/.zshrc 裡的 theme 設定

先安裝以下字形:

https://gist.github.com/qrush/1595572/raw/6c453ddc959b93895ffbf4fd904e2ba60256c904/Inconsolata-dz-Powerline.otf

https://gist.github.com/qrush/1595572/raw/6c453ddc959b93895ffbf4fd904e2ba60256c904/Menlo-Powerline.otf

https://gist.github.com/qrush/1595572/raw/6c453ddc959b93895ffbf4fd904e2ba60256c904/mensch-Powerline.otf

編輯/Users/你的用戶名/.bash_profile

找到:

ZSH_THEME="robbyrussell"

修改為:

# ZSH_THEME="robbyrussell"
ZSH_THEME="agnoster"

編輯/Users/你的用戶名/.oh-my-zsh/themes/agnoster.zsh-theme

把以下內容整個複製貼上取代:

https://gist.githubusercontent.com/sdlong/029f228d4bec233ab716/raw/953771ab3850f7a8a6cf96cfa266d0c3df11dce8/agnoster.zsh-theme

完成的樣子:


其他設定

iTerm2->Preferences->Profile Tab->Colors->Color Presets...->Solarized Dark

iTerm2->Preferences->Profile Tab->Window->Style->Buttom of Screen

iTerm2->Preferences->Profile Tab->Window->Setting For New Windws

Columns:120

Rows:20

iTerm2->Preferences->General->tmux Integration

Open tmux windows as tabs in existing windows


讓iTerm2繼承原本在bash的Command

編輯/Users/你的用戶名/.bash_profile

加入:

export PATH=/bin:/usr/bin:/usr/local/bin:$PATH

然後使用下列Command使其立即生效(否則重啟後才生效):

source ~/.bash_profile

編輯/Users/你的用戶名/.zshrc

source ~/.bash_profile

#亦可加入自訂command
#alias 自訂的command="自訂的指令檔App位置"

alias subl="/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"

設定React Native 預設用iterm2開啟

在任意地方新增(可為空白的).command 檔

Right click .command 檔

在 "Always open with..." 選取iTerm2

ref:http://courses.growthschool.com/courses/path-to-rails-developer/lectures/744466

results matching ""

    No results matching ""