Windows 11终端美化配置

Windows 11终端美化配置

windows11 终端配置美化

  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下执行下面命令进行安装
    winget install JanDeDobbeleer.OhMyPosh
    # 升级版本执行下面命令
    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

    设置默认的启动环境

    设置默认的启动环境

  2. 修改字体

    修改字体

  3. 配置文件json说明

    查看配置文件的位置

    # 查看配置文件的位置
    echo $profile
    

    第一次安装之后下面的文件是不存在的,需要创建

    创建powershell目录

    创建文件

    创建文件,注意文件后缀

    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\ 可以个人爱好使用不用的主题

    修改配置文件

    查看主题,执行下面命令查看

    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
    
  • 1
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值