Visual Studio Code 中使用 Oh-My-Zsh

  1. 先安裝在Visual Studio Code在Mac上
    Visual Studio Code 的基本安裝真的很簡單,解壓縮後執行應用程式即可
Image for post
Image for post

2.安裝zsh command line.

原作者寫得非常詳細
https://medium.com/statementdog-engineering/prettify-your-zsh-command-line-prompt-3ca2acc967f
2–1. 安裝iTerm2

2–2. 修改 iTerm2 的 color scheme
Preferences > Profiles > Colors > Color Presets
修改自己要的主題配色

Image for post
Image for post

2–3. 安裝 powerline font

因為theme會用到很多特殊 icon,這類型的字體統稱為 powerline font.支援 powerline 的字型很多, 這裡我就照原作者的建議下載Sauce Code Pro Nerd Font Complete

裝完後,記得修改 iTerm2 字型設定
Preferences > Profiles > Text > Change Font

Image for post
Image for post

在Visual Studio Code也要安裝powerline字型包,不然terminal執行zsh也會破圖
在Setting的Commonly Used,修改Font Family,加上SauceCodePro Nerd Font

Image for post
Image for post

https://medium.com/@wifferlin0505/%E5%9C%A8-visual-studio-code-terminal-%E4%B8%AD%E4%BD%BF%E7%94%A8-oh-my-zsh-799cb106df75

2–4. (optional)安裝 powerlevel9k

不是 oh-my-zsh 內建的 theme ,必須另外下載

編輯你的 ,把 ZSH_THEME 設為 powerlevel9k,然後設定要顯示哪些東西在 command line 上

https://github.com/Powerlevel9k/powerlevel9k

Image for post
Image for post

Written by

YAML engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store