推荐好玩的工具之OhMyPosh使用

  1. 解除禁止脚本

    Set-ExecutionPolicy RemoteSigned

  2. 下载Oh My Posh

    winget install oh-my-posh

    或者

    Install-Module oh-my-posh -Scope AllUsers

  3. 下载Git提示

    Install-Module posh-git -Scope CurrentUser

    或者

    Install-Module posh-git -Scope AllUser

  4. 下载命令提示

    Install-Module PSReadLine -RequiredVersion 2.1.0

  5. 添加配置

    notepad $profile

    添加以下配置

    Import-Module PSReadLine
    Set-PSReadLineOption -PredictionSource History
    Set-PSReadLineKeyHandler -Chord "Ctrl+RightArrow" -Function ForwardWord
    Import-Module posh-git
    oh-my-posh init pwsh --config D:\ProgramData\PowerShellTheme\onehalf.minimal.omp.json | Invoke-Expression
    

    注意: D:\ProgramData\PowerShellTheme\onehalf.minimal.omp.json为添加主题JSON文件本地路劲(主题列表:Themes | Oh My Posh),可以在主题列表里面选择自己喜欢的

  6. 添加font,(可选,这是设置自己字体类型)

  7. 设置font

  8. oh-my-posh报错重启电脑(注意C盘用户名为中文

  9. 配置流程出现问题

    可能原因:oh-my-posh不再维护windows shell版本,官网:https://ohmyposh.dev/docs/

    Installation→Windows→manual,复制指令进终端:

    Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
    
    

本人选的主题

在这里插入图片描述

  • 4
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值