mirror of
https://github.com/m1ngsama/winfig.git
synced 2026-02-08 01:14:05 +00:00
add some func and a theme
This commit is contained in:
parent
4000cda587
commit
6ba8dabf0a
3 changed files with 284 additions and 0 deletions
121
powershell/m1ng.omp.json
Normal file
121
powershell/m1ng.omp.json
Normal file
|
|
@ -0,0 +1,121 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "prompt",
|
||||
"alignment": "left",
|
||||
"segments": [
|
||||
{
|
||||
"leading_diamond": "\u256d\u2500\ue0b6",
|
||||
"foreground": "#ffffff",
|
||||
"background": "#0077c2",
|
||||
"type": "shell",
|
||||
"style": "diamond"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"prefix": "<parentBackground>\ue0b0</> ",
|
||||
"root_icon": "\uf292"
|
||||
},
|
||||
"foreground": "#FFFB38",
|
||||
"background": "#ef5350",
|
||||
"type": "root",
|
||||
"style": "diamond"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"enable_hyperlink": true,
|
||||
"style": "full"
|
||||
},
|
||||
"foreground": "#E4E4E4",
|
||||
"powerline_symbol": "\ue0b0",
|
||||
"background": "#444444",
|
||||
"type": "path",
|
||||
"style": "powerline"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"branch_icon": "\ue725 ",
|
||||
"fetch_status": true,
|
||||
"fetch_upstream_icon": true,
|
||||
"template": "{{ .HEAD }} {{ if .Working.Changed }}{{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#ef5350> \uf046 {{ .Staging.String }}</>{{ end }}"
|
||||
},
|
||||
"foreground": "#011627",
|
||||
"powerline_symbol": "\ue0b0",
|
||||
"background": "#FFFB38",
|
||||
"type": "git",
|
||||
"style": "powerline",
|
||||
"background_templates": [
|
||||
"{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb95{{ end }}",
|
||||
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#c5e478{{ end }}",
|
||||
"{{ if gt .Ahead 0 }}#C792EA{{ end }}",
|
||||
"{{ if gt .Behind 0 }}#C792EA{{ end }}"
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "prompt",
|
||||
"alignment": "right",
|
||||
"segments": [
|
||||
{
|
||||
"properties": {
|
||||
"display_package_manager": true,
|
||||
"npm_icon": " <#cc3a3a>\ue5fa</> ",
|
||||
"postfix": "",
|
||||
"prefix": "\ue718 ",
|
||||
"yarn_icon": " <#348cba>\uf61a</>"
|
||||
},
|
||||
"leading_diamond": " \ue0b6",
|
||||
"trailing_diamond": "\ue0b4",
|
||||
"foreground": "#3C873A",
|
||||
"background": "#303030",
|
||||
"type": "node",
|
||||
"style": "diamond"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"postfix": " ",
|
||||
"prefix": " \udb80\udcf0 "
|
||||
},
|
||||
"leading_diamond": " \ue0b6",
|
||||
"trailing_diamond": "\ue0b4",
|
||||
"foreground": "#ffffff",
|
||||
"background": "#40c4ff",
|
||||
"type": "time",
|
||||
"style": "diamond",
|
||||
"invert_powerline": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "prompt",
|
||||
"alignment": "left",
|
||||
"segments": [
|
||||
{
|
||||
"properties": {
|
||||
"postfix": "",
|
||||
"prefix": "",
|
||||
"text": "\u2570\u2500"
|
||||
},
|
||||
"foreground": "#21c7c7",
|
||||
"type": "text",
|
||||
"style": "plain"
|
||||
},
|
||||
{
|
||||
"properties": {
|
||||
"always_enabled": true,
|
||||
"display_exit_code": false,
|
||||
"error_color": "#ef5350",
|
||||
"prefix": "❯"
|
||||
},
|
||||
"foreground": "#e0f8ff",
|
||||
"type": "exit",
|
||||
"style": "plain"
|
||||
}
|
||||
],
|
||||
"newline": true
|
||||
}
|
||||
],
|
||||
"version": 3
|
||||
}
|
||||
127
powershell/m1ng.omp.json.bak
Normal file
127
powershell/m1ng.omp.json.bak
Normal file
|
|
@ -0,0 +1,127 @@
|
|||
{
|
||||
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
||||
"final_space": false,
|
||||
"osc99": true,
|
||||
"blocks": [
|
||||
{
|
||||
"type": "prompt",
|
||||
"alignment": "left",
|
||||
"segments": [
|
||||
{
|
||||
"type": "shell",
|
||||
"style": "diamond",
|
||||
"leading_diamond": "╭─",
|
||||
"trailing_diamond": "",
|
||||
"foreground": "#ffffff",
|
||||
"background": "#0077c2",
|
||||
"properties": {
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "root",
|
||||
"style": "diamond",
|
||||
"leading_diamond": "",
|
||||
"trailing_diamond": "",
|
||||
"foreground": "#FFFB38",
|
||||
"background": "#ef5350",
|
||||
"properties": {
|
||||
"root_icon": "\uf292",
|
||||
"prefix": "<parentBackground>\uE0B0</> "
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "path",
|
||||
"style": "powerline",
|
||||
"powerline_symbol": "\uE0B0",
|
||||
"foreground": "#E4E4E4",
|
||||
"background": "#444444",
|
||||
"properties": {
|
||||
"style": "full",
|
||||
"enable_hyperlink": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "git",
|
||||
"style": "powerline",
|
||||
"powerline_symbol": "\uE0B0",
|
||||
"foreground": "#011627",
|
||||
"background": "#FFFB38",
|
||||
"background_templates": [
|
||||
"{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb95{{ end }}",
|
||||
"{{ if and (gt .Ahead 0) (gt .Behind 0) }}#c5e478{{ end }}",
|
||||
"{{ if gt .Ahead 0 }}#C792EA{{ end }}",
|
||||
"{{ if gt .Behind 0 }}#C792EA{{ end }}"
|
||||
],
|
||||
"properties": {
|
||||
"branch_icon": "\ue725 ",
|
||||
"fetch_status": true,
|
||||
"fetch_upstream_icon": true,
|
||||
"template": "{{ .HEAD }} {{ if .Working.Changed }}{{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#ef5350> \uF046 {{ .Staging.String }}</>{{ end }}"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "prompt",
|
||||
"alignment": "right",
|
||||
"segments": [
|
||||
{
|
||||
"type": "node",
|
||||
"style": "diamond",
|
||||
"leading_diamond": " \uE0B6",
|
||||
"trailing_diamond": "\uE0B4",
|
||||
"foreground": "#3C873A",
|
||||
"background": "#303030",
|
||||
"properties": {
|
||||
"prefix": "\uE718 ",
|
||||
"postfix": "",
|
||||
"display_package_manager": true,
|
||||
"yarn_icon": " <#348cba></>",
|
||||
"npm_icon": " <#cc3a3a></> "
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "time",
|
||||
"style": "diamond",
|
||||
"invert_powerline": true,
|
||||
"leading_diamond": " \uE0B6",
|
||||
"trailing_diamond": "\uE0B4",
|
||||
"background": "#40c4ff",
|
||||
"foreground": "#ffffff",
|
||||
"properties": {
|
||||
"prefix": " \udb80\udcf0 ",
|
||||
"postfix": " "
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "prompt",
|
||||
"alignment": "left",
|
||||
"newline": true,
|
||||
"segments": [
|
||||
{
|
||||
"type": "text",
|
||||
"style": "plain",
|
||||
"foreground": "#21c7c7",
|
||||
"properties": {
|
||||
"prefix": "",
|
||||
"postfix": "",
|
||||
"text": "╰─"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "exit",
|
||||
"style": "plain",
|
||||
"foreground": "#e0f8ff",
|
||||
"properties": {
|
||||
"prefix": "\u276F",
|
||||
"display_exit_code": false,
|
||||
"always_enabled": true,
|
||||
"error_color": "#ef5350"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
36
powershell/user_profile.ps1
Normal file
36
powershell/user_profile.ps1
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# set PowerShell to UTF-8
|
||||
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
|
||||
|
||||
Import-Module posh-git
|
||||
$omp_config = Join-Path $PSScriptRoot ".\m1ng.omp.json"
|
||||
oh-my-posh --init --shell pwsh --config $omp_config | Invoke-Expression
|
||||
|
||||
Import-Module -Name Terminal-Icons
|
||||
|
||||
# PSReadLine
|
||||
Set-PSReadLineOption -EditMode Emacs
|
||||
Set-PSReadLineOption -BellStyle None
|
||||
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
|
||||
Set-PSReadLineOption -PredictionSource History
|
||||
|
||||
# Fzf
|
||||
Import-Module PSFzf
|
||||
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReverseHistory 'Ctrl+r'
|
||||
|
||||
# Env
|
||||
$env:GIT_SSH = "C:\Windows\system32\OpenSSH\ssh.exe"
|
||||
|
||||
# Alias
|
||||
Set-Alias -Name vim -Value nvim
|
||||
Set-Alias ll ls
|
||||
Set-Alias g git
|
||||
Set-Alias grep findstr
|
||||
Set-Alias tig 'C:\Users\m1ngsama\scoop\apps\git\2.47.1.2\usr\bin\tig.exe'
|
||||
Set-Alias less 'C:\Users\m1ngsama\scoop\apps\git\2.47.1.2\usr\bin\less.exe'
|
||||
|
||||
# Utilities
|
||||
function which ($command) {
|
||||
Get-Command -Name $command -ErrorAction SilentlyContinue |
|
||||
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
Loading…
Reference in a new issue