故事
首页
指南
  • Java
  • Python
  • Linux
  • 前端
  • Docker
  • 实践
  • 折腾
  • 分类
  • 标签
  • 归档
壁纸 (opens new window)
GitHub (opens new window)
首页
指南
  • Java
  • Python
  • Linux
  • 前端
  • Docker
  • 实践
  • 折腾
  • 分类
  • 标签
  • 归档
壁纸 (opens new window)
GitHub (opens new window)
  • 工具

    • git命令整理
    • Markdown基础语法
    • Typora、PicGo、七牛云实现markdown图片自动上传图床
    • iterm2配合oh-my-zsh配置个性主题终端
    • iterm2配置ssh快速连接
    • 各系统下校验文件一致性
    • linux设置macOS时间机器server
  • 环境

    • Windows下Docker Desktop安装
    • git配置socks5代理解决github上down代码慢的问题
    • mysql启动报错排查及处理
    • macOS开启终端的代理
    • git配置多ssh-key && Gitee 和 Github 同步更新
    • docker+jenkins+gitee自动化部署vue项目
    • 使用github actions进行持续部署
    • macos开机自动执行脚本
    • powershell美化
      • 安装windows terminal和powershell
      • 安装oh-my-posh
      • 安装Nerd Fonts
      • 编辑profile
        • 挑选喜欢的主题
  • 设计模式

    • 策略模式的具体实现
  • 简介
  • actions
  • 环境
storyxc
2022-06-07

powershell美化

# powershell美化

https://ohmyposh.dev/docs/

# 安装windows terminal和powershell

  • https://github.com/microsoft/terminal

  • https://docs.microsoft.com/zh-cn/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.2

# 安装oh-my-posh

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

# 安装Nerd Fonts

如果不安装Nerd Fonts会有乱码情况,oh-my-posh推荐安装Meslo LGM NF (opens new window)字体,也可以从https://www.nerdfonts.com/font-downloads自行选择下载。下载后解压放到C:\windows\Fonts文件夹中。编辑Windows Terminal默认设置将默认字体改为喜欢的Nerd Fonts。

# 编辑profile

code $PROFILE或notepad $PROFILE

oh-my-posh init pwsh | Invoke-Expression # 默认主题

oh-my-posh init pwsh --config C:\Users\story\AppData\Local\Programs\oh-my-posh\themes\robbyrussel.omp.json | Invoke-Expression # --config可以配置喜欢的主题

--config 'https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/jandedobbeleer.omp.json' # 也可以配置远程主题
1
2
3
4
5
# 设置预测文本来源为历史记录
Set-PSReadLineOption -PredictionSource History
# 设置向上键为后向搜索历史记录
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
# 设置向下键为前向搜索历史纪录
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward

1
2
3
4
5
6
7

windows安装后默认的主题文件夹为:C:\Users\[your username]\AppData\Local\Programs\oh-my-posh\themes,也可以通过echo $env:POSH_THEMES_PATH命令查看主题的路径

# 挑选喜欢的主题

  • https://ohmyposh.dev/docs/themes

配置立即生效:

. $PROFILE
1

效果图:

  • 默认:

    image-20220607011525725

  • jandedobbeleer:

    image-20220607011557983

编辑 (opens new window)
#powershell#oh-my-posh
上次更新: 2023/03/24, 23:40:02
macos开机自动执行脚本
策略模式的具体实现

← macos开机自动执行脚本 策略模式的具体实现→

Theme by Vdoing | Copyright © 2019-2023 story | 豫ICP备19046036号
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式