Windows 11終端美化配置

windows11 終端配置美化_嗶哩嗶哩_bilibili

  1. 下載安裝terminal
  2. 安裝oh-my-posh
  3. 安裝power shell core
  4. 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配置

  1. 配置powershellcore

    配置powershellcore

    設置默認的啟動環(huán)境

    設置默認的啟動環(huán)境
  2. 修改字體

    修改字體
  3. 配置文件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 ""
    }
    
  4. 配置oh-my-posh

  5. 美化終端圖標

    Install-Module -Name Terminal-Icons -Repository PSGallery
    Import-Module -Name Terminal-Icons
    
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容