You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# For zsh syntax-highlighting
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
修改 prompt
因為預設的是 user@hostname, 很長很鬧
$ whoami
知道我是誰後
再打開 ZSH 設定檔, 加入下面這段, username 就是剛剛顯示的使用者名稱
# optionally set DEFAULT_USER in ~/.zshrc to your regular username to hide the “user@hostname” info when you’re logged in as yourself on your local machine.
DEFAULT_USER=username
iTerm2 + Oh My Zsh 安裝&設定
安裝 brew (有裝過 brew 可以跳過此步驟)
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安裝 iTerm2
安裝好後設定 color scheme 為
Solarized Dark
安裝 Oh My Zsh
$ sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
看看是否成功
把預設的終端機改為zsh
重新開啟終端機, 輸入
成功的話會顯示
/usr/local/bin/zsh
更改設定檔
$ vi ~/.zshrc
找到
ZSH_THEME=”…”
, 修改主題為tonotdo
安裝 Oh My Zsh 外掛
Auto Suggestions
酷酷的會提示打過的字, 按方向鍵右可以直接補完
$ git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
一樣更改設定檔,以空格分開
背景色會和提示字體太接近而看不到, 這裡可以更改字體顏色
$ vi $ZSH_CUSTOM/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
找到
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=8'
, 修改fg=240
Syntax Highlighting
打出正確的字元後會高亮, 例如
node
,which
以防不小心打錯字一樣打開設定檔, 在最下面加上這行
修改 prompt
因為預設的是
user@hostname
, 很長很鬧知道我是誰後
再打開 ZSH 設定檔, 加入下面這段,
username
就是剛剛顯示的使用者名稱# optionally set DEFAULT_USER in ~/.zshrc to your regular username to hide the “user@hostname” info when you’re logged in as yourself on your local machine. DEFAULT_USER=username
使用鍵盤上的 Home/End 鍵
打開設定檔加入下面這段
The text was updated successfully, but these errors were encountered: