WindowsTerminal中oh-my-posh样式的cmd、git-bash、cmder配置参数

news2024/9/29 4:53:28

在这里插入图片描述
C:\Users\root\Documents\WindowsPowerShell中写如下内容

Import-Module posh-git # 引入 posh-git
Import-Module oh-my-posh # 引入 oh-my-posh
Import-Module -Name Terminal-Icons  # 引入文件图标库
Import-Module PSReadLine # 历史命令联想
# 设置主题
Set-PoshPrompt -Theme D:\software\oh-my-posh\themes\kushal.omp.json
# Set-PSReadLineOption -PredictionSource History # 设置预测文本来源为历史记录
# Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete # 设置 Tab 键,命令行自动补全和提示
# Set-PSReadLineKeyHandler -Key "Ctrl+d" -Function MenuComplete # 设置 Ctrl+d 为菜单补全和 Intellisense
# Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward # 设置向上键为后向搜索历史记录
# Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward # 设置向下键为前向搜索历史纪录


# 设置预测文本来源为历史记录 
Set-PSReadLineOption -PredictionSource History 
# 设置 Tab 为菜单补全和 Intellisense 
Set-PSReadlineKeyHandler -Key Tab -Function Complete # 设置 Tab 键补全
Set-PSReadLineKeyHandler -Key "Ctrl+d" -Function MenuComplete # 设置 Ctrl+d 为菜单补全和 Intellisense
Set-PSReadLineKeyHandler -Key "Ctrl+z" -Function Undo # 设置 Ctrl+z 为撤销

Set-PSReadLineKeyHandler -Key UpArrow -ScriptBlock {
[Microsoft.PowerShell.PSConsoleReadLine]::HistorySearchBackward()
[Microsoft.PowerShell.PSConsoleReadLine]::EndOfLine()
} # 设置向上键为后向搜索历史记录,并将光标移动到行尾

Set-PSReadLineKeyHandler -Key DownArrow -ScriptBlock {
[Microsoft.PowerShell.PSConsoleReadLine]::HistorySearchForward()
[Microsoft.PowerShell.PSConsoleReadLine]::EndOfLine()
} # 设置向下键为前向搜索历史纪录,并将光标移动到行尾

在这里插入图片描述
D:**\clink\on-my-posh.lua中写如下内容

load(io.popen('oh-my-posh init cmd --config D:/software/oh-my-posh/themes/kushal.omp.json'):read("*a"))()

在这里插入图片描述

配置文件kushal.omp.json放入C:\Users\root\目录下
C:\Users\root.profile中写如下内容

eval "$(oh-my-posh --init --shell bash --config ~/kushal.omp.json)"

要加 -i -l


在这里插入图片描述
要加cmd.exe /k


在这里插入图片描述
要取消勾选仅显示等宽字体


亮色配色
在这里插入图片描述
kushal.omp.json,修改自kushal.omp.json

{
  "$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
  "console_title_template": "{{ if .Root }}root @ {{ end }}{{ .Shell }} in {{ .Folder }}",
  "blocks": [
    {
      "alignment": "left",
      "segments": [
        {
          "background": "#575656",
          "foreground": "#d3e4ff",
          "leading_diamond": "\ue0b2",
          "properties": {
            "alpine": "\uf300",
            "arch": "\uf303",
            "centos": "\uf304",
            "debian": "\uf306",
            "elementary": "\uf309",
            "fedora": "\uf30a",
            "gentoo": "\uf30d",
            "linux": "\ue712",
            "macos": "\ue711",
            "manjaro": "\uf312",
            "mint": "\uf30f",
            "opensuse": "\uf314",
            "raspbian": "\uf315",
            "ubuntu": "\uf31c",
            "windows": "\ue70f"
          },
          "style": "diamond",
          "template": " {{ if .WSL }}\ue712 on {{ end }}{{ .Icon }} ",
          "type": "os"
        },
        {
          "background": "#00C7FC",
          "foreground": "#011627",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "template": " \uf489 {{ .Name }} ",
          "type": "shell"
        },
        {
          "background": "#EF541C",
          "foreground": "#d3e4ff",
          "powerline_symbol": "\ue0b0",
          "style": "powerline",
          "template": " \uf09c admin ",
          "type": "root"
        },
        {
          "type": "cmake",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#E8EAEE",
          "background": "#1E9748",
          "template": " \ue61e \ue61d cmake {{ .Full }} "
        },
        {
          "type": "python",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "display_mode": "context"
          },
          "foreground": "#011627",
          "background": "#FFDE57",
          "template": " \ue73c {{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }} "
        },
        {
          "type": "go",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#ffffff",
          "background": "#7FD5EA",
          "template": " \u202d\ue626 {{ .Full }} "
        },
        {
          "type": "rust",
          "style": "powerline",
          "powerline_symbol": "\ue0b0",
          "foreground": "#193549",
          "background": "#99908A",
          "template": " \ue7a8 {{ .Full }} "
        },
        {
          "background": "#1BD4CD",
          "background_templates": [
            "{{ if or (.Working.Changed) (.Staging.Changed) }}#16B1AC{{ end }}",
            "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#16B1AC{{ end }}",
            "{{ if gt .Ahead 0 }}#B787D7{{ end }}",
            "{{ if gt .Behind 0 }}#B787D7{{ end }}"
          ],
          "foreground": "#011627",
          "powerline_symbol": "\ue0b0",
          "properties": {
            "branch_icon": "\ue725 ",
            "fetch_stash_count": true,
            "fetch_status": true,
            "fetch_upstream_icon": true,
            "fetch_worktree_count": true
          },
          "style": "powerline",
          "template": " {{ .UpstreamIcon }}{{ .HEAD }}{{if .BranchStatus }} {{ .BranchStatus }}{{ end }}{{ if .Working.Changed }} \uf044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#CAEBE1> \uf046 {{ .Staging.String }}</>{{ end }}{{ if gt .StashCount 0 }} \ueb4b {{ .StashCount }}{{ end }} ",
          "type": "git"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "right",
      "segments": [
        {
          "background": "#03DED3",
          "background_templates": [
            "{{ if gt .Code 0 }}#E44141{{ end }}"
          ],
          "foreground": "#414141",
          "foreground_templates": [
            "{{ if gt .Code 0 }}#7aabfc{{ end }}"
          ],
          "leading_diamond": "\ue0b6",
          "properties": {
            "always_enabled": true
          },
          "style": "diamond",
          "template": " {{ if gt .Code 0 }}\uf00d{{ else }}\uf00c{{ end }} ",
          "type": "status"
        },
        {
          "background": "#575656",
          "foreground": "#7aabfc",
          "properties": {
            "style": "roundrock",
            "threshold": 0
          },
          "style": "diamond",
          "template": " \uf252 {{ .FormattedMs }} ",
          "trailing_diamond": "\ue0b4",
          "type": "executiontime"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#7aabfc",
          "style": "plain",
          "template": "\u256d\u2500",
          "type": "text"
        },
        {
          "foreground": "#bd7939",
          "properties": {
            "time_format": "<#7aabfc>\ue641 15:04:05</> <#79DFE1>|</> \uf073 2 Jan, Monday"
          },
          "style": "plain",
          "template": "{{ .CurrentDate | date .Format }} <#79DFE1>|</>",
          "type": "time"
        },
        {
          "foreground": "#3e7fb7",
          "leading_diamond": "<#00C7FC> \uf07b </><#3e7fb7> in </>",
          "properties": {
            "folder_icon": " \uf07c ",
            "folder_separator_icon": " \uf061 ",
            "home_icon": "\ueb06 ",
            "style": "agnoster_short",
            "max_depth": 3
          },
          "style": "diamond",
          "template": " {{ .Path }} ",
          "type": "path"
        }
      ],
      "type": "prompt"
    },
    {
      "alignment": "left",
      "newline": true,
      "segments": [
        {
          "foreground": "#7aabfc",
          "style": "plain",
          "template": "\u2570\u2500",
          "type": "text"
        },
        {
          "foreground": "#7aabfc",
          "properties": {
            "always_enabled": true
          },
          "style": "plain",
          "template": "\u276f ",
          "type": "status"
        }
      ],
      "type": "prompt"
    }
  ],
  "osc99": true,
  "transient_prompt": {
    "background": "transparent",
    "foreground": "#FEF5ED",
    "template": "\ue285 "
  },
  "secondary_prompt": {
    "background": "transparent",
    "foreground": "#7aabfc",
    "template": "\u2570\u2500\u276f "
  },
  "version": 2
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2175827.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

MQTT.fx 1.7.1使用说明篇(OneNET-MQTT-API调试)

&#xff08;代码完美实现&#xff09;stm32 新版 onenet mqtt物联网(保姆级教程) &#xff08;代码完美实现&#xff09;stm32 新版 onenet mqtt物联网(保姆级教程)https://blog.csdn.net/Wang2869902214/article/details/142501323 MQTT.fx 1.7.1使用教程 下载地址 MQ…

DualGS:高效人体体积视频渲染技术,实现复杂4D数字人表演的实时播放引言

随着虚拟现实(VR)和增强现实(AR)技术的发展,对高质量、低延迟的人体体积视频的需求日益增长。传统的视频压缩和渲染方法在处理复杂的4D人体动作时往往面临性能瓶颈。为了解决这一问题,研究人员开发了一种名为DualGS的新型高效人体体积视频渲染技术。本文将详细介绍DualGS…

54K55LyB5p2l5a6i5pyN57O757uf token硬编码漏洞

0x01 产品描述&#xff1a; 54K55LyB5p2l5a6i5pyN57O757uf是独立源码部署的客服系统&#xff0c;支持接入到小程序、公众号、网站、APP。私有化源码部署&#xff0c;数据可控&#xff0c;稳定可靠。可自定义版权、logo。支持网页、微信公众号、小程序、App等任何程序对接 0x02…

JDK1.8安装配置教程(图文结合,最简洁易懂)

分为两大步骤&#xff1a;安装JDK、配置环境变量 (环境变量是什么&#xff1f;) 一、安装JDK 1、双击运行安装程序 2、点击【下一步】 3.点击【公共JRE】&#xff0c;选择【此功能将不可用】&#xff0c;点击【下一步】 4.安装完成&#xff0c;点击【关闭】 二、配置…

完全二叉树的递归创建思路及代码

文章目录 &#x1f34a;自我介绍&#x1f34a;创建思路图形完全二叉树的结论设计图例 &#x1f34a;创建代码编写bitree.cbitree.hmain.c 你的点赞评论就是对博主最大的鼓励 当然喜欢的小伙伴可以&#xff1a;点赞关注评论收藏&#xff08;一键四连&#xff09;哦~ &#x1f34…

使用 Git 帮助文档

聊聊如何更好地查阅官方文档。 ‍ git help 学习某个工具&#xff0c;官方文档是少不了的&#xff0c;也是最权威的。我们可以使用 git help 来查看帮助&#xff0c;该命令会列举出常用的命令和介绍&#xff1a; > git help usage: git [--version] [--help] [-C <pa…

ComfyUI | 好用的人体 衣服分割工具-③-Layer Style | 超多实用功能 | 强烈推荐

这里为大家分享检测人体的脸部、五官、头发、手臂、腿、脚&#xff0c;上衣、裤子、背景的插件&#xff0c;能够生成出对应的蒙版mask&#xff0c;接入到ComfyUI中&#xff0c;用于后续处理&#xff0c;如局部重绘&#xff0c;换背景等。 &#xff08;需要相关插件的同学可自…

后端Java-SpringBoot整合MyBatisPlus步骤(超详细)

1.新建项目。 2.点击完上一步的next之后&#xff0c;选择pom.xml文件中的依赖。 3.点击pom文件进行项目初始化。 按照下面的俩步骤刷新一下maven &#xff0c;让文件生效 4.新建一个application.yml文件 5. 新建一个数据库mp&#xff0c;在数据库中新建一张user表 6.连接数据…

Java: 数据类型与变量和运算符

目录 一 .字面常量 二.数据类型 三.变量 1.语法格式 2.整型变量 (1).整型变量 (2). 长整型变量 (3).短整型变量 (4).字节型变量 3.浮点型变量 (1).双精度浮点型 (2).单精度浮点型 4.字符型变量 5.布尔型变量 四.类型转换 1.自动类型转换(隐式) 2.强制类型转换(…

螺钉生产线缺陷检测系统源码分享

螺钉生产线缺陷检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Comput…

JNI实现Java调用C++函数

1. 测试环境 操作系统&#xff1a;win10JDK版本&#xff1a;JDK11 安装教程gcc版本&#xff1a;8.1.0 2. 声明native方法 // HelloJNI.java public class HelloJNI {// 输出Hello JNI from CPP. private native static void sayHello();// 实现两个整数相加private native s…

UE4_Niagara基础实例—2、使用自定义模块

功能实现&#xff1a;用音频来触发粒子特效。 效果&#xff1a; 根据音量调节粒子大小 分析&#xff1a;我们想通过音量来控制Curl Noise Forc强度e的strength参数&#xff0c;但经过搜索会发现既没有这个参数&#xff0c;也没有这个模块&#xff0c;那么只能自定义这个模块。…

【2023工业3D异常检测文献】PointCore: 基于局部-全局特征的高效无监督点云异常检测器

PointCore: Efficient Unsupervised Point Cloud Anomaly Detector Using Local-Global Features 1、Background 当前的点云异常检测器可以分为两类&#xff1a; &#xff08;1&#xff09;基于重建的方法&#xff0c;通过自动编码器重建输入点云数据&#xff0c;并通过比较原…

【matlab画多纵坐标图像】

一 、什么是多纵坐标图像 多纵坐标图像是一种在同一个坐标系中&#xff0c;使用多个纵坐标轴来表示不同的数据指标的图像。在多纵坐标图中&#xff0c;每个纵坐标轴可以有不同的刻度和单位&#xff0c;用于表示不同的数据范围。这样可以方便地比较不同指标的变化趋势&#xff0…

JAVA入门-集合与泛型

目录 一、集合体系结构 二、Collection单列集合 2.1 概述 2.2 基本方法与接口 2.3 遍历方式 2.3.1 迭代器遍历 2.3.2 增强for遍历 2.3.3 Lamda表达式遍历 三、List集合 3.1 ArrayList集合 3.2 LinkedList集合 四、泛型 4.1 泛型擦除 4.2 泛型使用 4.2.1 泛型类 …

SPAD 单光子雪崩二极管

一、简介 SPAD&#xff0c;全称为Single Photon Avalanche Diode&#xff08;单光子雪崩二极管&#xff09;&#xff0c;是一种高灵敏度的光电探测器件&#xff0c;能够在非常低的光照水平下检测单个光子。SPAD在工作时&#xff0c;当一个光子被探测器吸收后&#xff0c;能够触…

如何高效搭建TEMU自养号测评系统?

TEMU全托管模式当前的优势在于其简化运营流程&#xff0c;允许卖家专注于产品选品与质量控制&#xff0c;而无需直接参与日常运营。然而&#xff0c;这一模式也限制了卖家在营销策略上的自主性&#xff0c;促使部分卖家采取自养号测评的方式&#xff0c;以增强产品链接的竞争力…

精通推荐算法32:行为序列建模总结

1 行为序列建模总体架构 2 行为序列整体总结 用户行为序列建模是推荐算法中至关重要的一环&#xff0c;也是目前较为核心和前沿的研究方向。其主要分为短序列建模和长序列建模两大方向。短序列建模又主要分为池化和序列化两种方式&#xff0c;其中池化包括Sum-Pooling、Averag…

828华为云征文 | 使用 Memtester 对华为云 X 实例进行内存性能测试

目录 前言 1 华为云X实例介绍 2 Memtester 简介 2.1 什么是Memtester 2.2 安装 Memtester 3 测试方案设计 3.1 测试目标 3.2 测试环境 3.3 测试命令 4 测试数据及性能分析 4.1 带宽测试结果 4.2 延迟测试结果 5 性能瓶颈与优化建议 6 总结 前言 在云计算的应用场…

Spring Boot 点餐系统:简化您的订餐流程

第五章 系统实现 5.1用户功能模块 用户点击进入到系统操作界面&#xff0c;可以对首页、个人中心、美食订单管理、美食评价管理、我的收藏管理等功能模块&#xff0c;个人信息&#xff1a;通过列表可以获取用户账号、用户姓名、性别、年龄、头像、用户手机、配送地址并进行修改…