Files
hugo_blog.awin.one/content/posts/2022/用 oh-my-posh 美化 Git bash/index.md

1.8 KiB
Raw Blame History

slug, title, description, toc, authors, tags, categories, series, date, lastmod, featuredVideo, featuredImage, draft, enableComment
slug title description toc authors tags categories series date lastmod featuredVideo featuredImage draft enableComment
用 oh-my-posh 美化 Git bash 用 oh-my-posh 美化 Git bash true
awin
terminal
Tool setup
Windows
2022-06-14T00:00:00 2022-06-14T00:00:00 false true

Windows Terminal 中的 Git bash 也可以美美的。

步驟

以下步驟都是在 Windows Terminal 中的 Git bash1 執行。

  1. 先下載一個你喜歡的theme: https://ohmyposh.dev/docs/themes
  2. 下載並安裝字型:Caskaydia Cove Nerd Font
  3. Install OhMyPosh: winget install JanDeDobbeleer.OhMyPosh
  4. 建立並修改 ~/.profile,然後加入
    eval "$(oh-my-posh --init --shell bash --config ~/OneDrive/appConfigs/ohmyposh/themes/montys.omp.json)"
    注意最後的 montys.omp.json 就是第一步下載的theme這邊要改成你自己的路徑。
  5. 修改 Windows Terminal 的 setting.json,將字型改為 CaskaydiaCove NF

成果

20220614_221915_WindowsTerminal_1244x262.png