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

devtools/2024/10/20 18:59:10/

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

bash">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中写如下内容

bash">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中写如下内容

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

要加 -i -l


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


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


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

bash">{"$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.ppmy.cn/devtools/122212.html

相关文章

组件中$router/$route的由来(vue-router源码分析)

1.vue-router源码下载 我们可以到github上找到对应版本的vue-router 版本号可以到项目中的node_modules/vue-router/dist/vue-router.js查看嘴上面的许可证说明(package.json只提供了版本的大致范围 ^表示2.2.x 而~表示2.x.x 都为>的含义) 在github上的vue-router我们要选择…

Linux常用指令

Linux常用命令 查询进程 ps aux | grep 进程名称 端口监听 sudo netstat -tulnp | grep 9944 显卡 查询显卡信息 lspci | grep VGA 查看显卡详情 sudo lshw -C video 显卡使用情况 nvidia-smi nvtop 系统与功耗 硬件资源 top 整机功耗/用电瓦数 sudo apt-get insta…

【SpringBoot】基础+JSR303数据校验

目录 一、Spring Boot概要 1. SpringBoot介绍 2. SpringBoot优点 3. SpringBoot缺点 4. 时代背景-微服务 二、Spring Boot 核心配置 1. Spring Boot配置文件分类 1.1 application.properties 1.2 application.yml 1.3 小结 2. YAML概述 3. YAML基础语法 3.1 注意事…

【分页】Spring Boot 列表分页 + javaScript前台展示

后端&#xff1a; 准备好查询实体与分页实体 1、分页工具实体 package com.ruoyi.dms.config;import com.alibaba.nacos.api.model.v2.Result; import lombok.Data;import java.io.Serializable; import java.util.List;/*** author 宁兴星* description: 列表返回结果集*/ …

Windows系统编程(三)进程与线程二

进程与线程 进程&#xff1a;直观的说就是任务管理器中各种正在运行的程序。对于操作系统来说&#xff0c;进程仅仅是一个数据结构&#xff0c;并不会真实的执行代码 线程&#xff1a;通常被称作但并不真的是轻量级进程或实际工作中的进程&#xff0c;它会真实的执行代码。每…

Pytorch中不会自动传播梯度的操作有哪些?

在 PyTorch 中&#xff0c;某些生成张量的操作本身不会创建与计算图相关联的梯度信息。这些操作通常用于初始化张量&#xff0c;并且默认情况下不需要进行梯度计算。以下是一些常见的不会自动传播梯度的张量生成操作&#xff1a; 数值初始化操作&#xff1a; torch.linspace():…

4. Getter和Setter注解与lombok

文章目录 1. 什么是Getter和Setter注解2. 什么是lombokjava自带的jar包 3. 从maven仓库里找lombok相关jar包4. 把jar包导入项目另一个jar包导入途径 5. 正式使用注解① 问题② 解决方案提示 6. 如果还想对某个成员变量添加限制怎么办7. 内容出处 1. 什么是Getter和Setter注解 官…

linux驱动开发之LED灯驱动(附驱动源码,适用于全志,瑞芯微等芯片)

最近学习linux驱动&#xff0c;前面讲述了字符型驱动开发的驱动编写框架以及具体步骤&#xff0c;而LED驱动是字符型驱动中最基础的&#xff0c;本次我们就来学习一下linux的LED灯驱动开发步骤&#xff0c;同时源码放出来供大家参考。 本次驱动开发适用于全志&#xff0c;瑞芯…