一、定義vscode終端樣式
(1)定義顏色
vscode定義主題色官網:https://code.visualstudio.com/api/references/theme-color#integrated-terminal-colors
"workbench.colorCustomizations": { "terminal.background":"#131212", "terminal.foreground":"#dddad6", "terminal.ansiBlack":"#1D2021", "terminal.ansiBrightBlack":"#665C54", "terminal.ansiBrightBlue":"#0D6678", "terminal.ansiBrightCyan":"#8BA59B", "terminal.ansiBrightGreen":"#237e02", "terminal.ansiBrightMagenta":"#8F4673", "terminal.ansiBrightRed":"#FB543F", "terminal.ansiBrightWhite":"#FDF4C1", "terminal.ansiBrightYellow":"#FAC03B", "terminal.ansiCyan":"#8BA59B", "terminal.ansiGreen":"#95C085", "terminal.ansiMagenta":"#8F4673", "terminal.ansiRed":"#FB543F", "terminal.ansiWhite":"#A89984", "terminal.ansiYellow":"#FAC03B" "terminal.ansiBlue":"#00a1f9" }
(2)定義主題色
"editor.fontFamily": "Menlo for Powerline,Fira Code,Menlo, Monaco, 'Courier New', monospace",
二、美化終端
三、美化iterm2
(1)安裝方法
(a)官網安裝:https://www.iterm2.com/downloads.html 下載完成之后直接直接執行即可
(b)homebrew安裝:
brew cask install iterm2
(2)配置主題
iTerm2 最常用的主題是 Solarized Dark theme,下載地址:http://ethanschoonover.com/solarized
下載的是壓縮文件,你先解壓一下,然后打開 iTerm2,按Command + ,
鍵,打開 Preferences 配置界面,然后Profiles -> Colors -> Color Presets -> Import
,選擇剛才解壓的solarized->iterm2-colors-solarized->Solarized Dark.itermcolors
文件,導入成功,最后選擇 Solarized Dark 主題,就可以了。
(3) 配置 Oh My Zsh
Oh My Zsh 是對主題的進一步擴展,地址:https://github.com/robbyrussell/oh-my-zsh
在終端輸入命令
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
安裝好之后,需要把 Zsh 設置為當前用戶的默認 Shell(這樣新建標簽的時候才會使用 Zsh):
chsh -s /bin/zsh
然后,我們編輯vim ~/.zshrc
文件,將主題配置修改為ZSH_THEME="agnoster"
。
(4)配置字體
使用上面的主題,需要 Meslo 字體支持,要不然會出現亂碼的情況,字體下載地址:Meslo LG M Regular for Powerline.ttf
下載好之后,直接在 Mac OS 中安裝即可。
然后打開 iTerm2,按Command + ,
鍵,打開 Preferences 配置界面,然后Profiles -> Text -> Font -> Chanage Font
,選擇 Meslo LG M Regular for Powerline 字體。
另外,VS Code 的終端字體,也需要進行配置,打開 VS Code,按Command + ,
鍵,打開用戶配置,搜索fontFamily
,然后將右邊的配置增加"terminal.integrated.fontFamily": "Meslo LG M for Powerline"