windows11 終端配置美化_嗶哩嗶哩_bilibili
- 下載安裝terminal
- 安裝oh-my-posh
- 安裝power shell core
- posh配置
terminal
工具軟件安裝
我們可以從Microsoft store上下載terminal和powershellcore
搜索terminal
搜索terminal
搜索powershell
搜索powershell
下載字體 : Caskaydia Cove Nerd Font Complete
下載地址:https://www.nerdfonts.com/font-downloads
下載字體
安裝oh-my-posh
下載地址:https://ohmyposh.dev/docs/windows
-
安裝
# 在powershell下執(zhí)行下面命令進行安裝 winget install JanDeDobbeleer.OhMyPosh # 升級版本執(zhí)行下面命令 winget upgrade JanDeDobbeleer.OhMyPosh
-
主題
主題路徑:~\AppData\Local\Programs\oh-my-posh\themes
~\AppData\Local\Programs\oh-my-posh\themes\jandedobbeleer.omp.json
terminal配置
-
配置powershellcore
配置powershellcore設置默認的啟動環(huán)境
設置默認的啟動環(huán)境 -
修改字體
修改字體 -
配置文件json說明
查看配置文件的位置
# 查看配置文件的位置 echo $profile
第一次安裝之后下面的文件是不存在的,需要創(chuàng)建
創(chuàng)建powershell目錄創(chuàng)建文件創(chuàng)建文件,注意文件后綴
image-20211105105727995粘貼下面的語句到配置文件中
oh-my-posh --init --shell pwsh --config ~\AppData\Local\Programs\oh-my-posh\themes\slim.omp.json | Invoke-Expression
主題路徑在:~\AppData\Local\Programs\oh-my-posh\themes\ 可以個人愛好使用不用的主題
修改配置文件查看主題,執(zhí)行下面命令查看
Get-ChildItem -Path "~\AppData\Local\Programs\oh-my-posh\themes\*" -Include '*.omp.json' | Sort-Object Name | ForEach-Object -Process { $esc = [char]27 Write-Host "" Write-Host "$esc[1m$($_.BaseName)$esc[0m" Write-Host "" oh-my-posh --config $($_.FullName) --pwd $PWD Write-Host "" }
配置oh-my-posh
-
美化終端圖標
Install-Module -Name Terminal-Icons -Repository PSGallery Import-Module -Name Terminal-Icons