move to ohmyposh for zsh
This commit is contained in:
66
.config/ohmyposh/config.toml
Normal file
66
.config/ohmyposh/config.toml
Normal file
@@ -0,0 +1,66 @@
|
||||
#:schema https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json
|
||||
|
||||
version = 2
|
||||
final_space = true
|
||||
console_title_template = '{{ .Shell }} in {{ .Folder }}'
|
||||
|
||||
[[blocks]]
|
||||
type = 'prompt'
|
||||
alignment = 'left'
|
||||
newline = true
|
||||
|
||||
[[blocks.segments]]
|
||||
type = 'path'
|
||||
style = 'plain'
|
||||
background = 'transparent'
|
||||
foreground = 'blue'
|
||||
template = '{{ .Path }}'
|
||||
|
||||
[blocks.segments.properties]
|
||||
style = 'full'
|
||||
|
||||
[[blocks.segments]]
|
||||
type = 'git'
|
||||
style = 'plain'
|
||||
foreground = 'p:grey'
|
||||
background = 'transparent'
|
||||
template = ' {{ .HEAD }}{{ if or (.Working.Changed) (.Staging.Changed) }}*{{ end }} <cyan>{{ if gt .Behind 0 }}⇣{{ end }}{{ if gt .Ahead 0 }}⇡{{ end }}</>'
|
||||
|
||||
[blocks.segments.properties]
|
||||
branch_icon = ''
|
||||
commit_icon = '@'
|
||||
fetch_status = true
|
||||
|
||||
[[blocks]]
|
||||
type = 'rprompt'
|
||||
overflow = 'hidden'
|
||||
|
||||
[[blocks.segments]]
|
||||
type = 'executiontime'
|
||||
style = 'plain'
|
||||
foreground = 'yellow'
|
||||
background = 'transparent'
|
||||
template = '{{ .FormattedMs }}'
|
||||
|
||||
[blocks.segments.properties]
|
||||
threshold = 5000
|
||||
|
||||
[[blocks]]
|
||||
type = 'prompt'
|
||||
alignment = 'left'
|
||||
newline = true
|
||||
|
||||
[[blocks.segments]]
|
||||
type = 'text'
|
||||
style = 'plain'
|
||||
foreground_templates = [
|
||||
"{{if gt .Code 0}}red{{end}}",
|
||||
"{{if eq .Code 0}}magenta{{end}}",
|
||||
]
|
||||
background = 'transparent'
|
||||
template = '❯'
|
||||
|
||||
[secondary_prompt]
|
||||
foreground = 'magenta'
|
||||
background = 'transparent'
|
||||
template = '❯❯ '
|
||||
@@ -1,25 +1,25 @@
|
||||
oh-my-posh init pwsh --config ~/.config/powershell/config.json | Invoke-Expression
|
||||
oh-my-posh init pwsh --config ~/.config/ohmyposh/config.toml | Invoke-Expression
|
||||
Set-PSReadLineOption -PredictionSource History
|
||||
|
||||
@(
|
||||
"cat,get-content"
|
||||
"cd,set-location"
|
||||
"clear,clear-host"
|
||||
"cp,copy-item"
|
||||
"history,get-history"
|
||||
"kill,stop-process"
|
||||
"ls,Get-ChildItem"
|
||||
"mv,move-item"
|
||||
"ps,get-process"
|
||||
"pwd,get-location"
|
||||
"which,get-command"
|
||||
"open,Invoke-Item"
|
||||
"basename,Split-Path"
|
||||
"realpath,resolve-path"
|
||||
"cat,get-content"
|
||||
"cd,set-location"
|
||||
"clear,clear-host"
|
||||
"cp,copy-item"
|
||||
"history,get-history"
|
||||
"kill,stop-process"
|
||||
"ls,Get-ChildItem"
|
||||
"mv,move-item"
|
||||
"ps,get-process"
|
||||
"pwd,get-location"
|
||||
"which,get-command"
|
||||
"open,Invoke-Item"
|
||||
"basename,Split-Path"
|
||||
"realpath,resolve-path"
|
||||
) | ForEach-Object {
|
||||
$Alias = ($PSItem -split ",")[0]
|
||||
$value = ($PSItem -split ",")[1]
|
||||
Set-Alias -Name $Alias -Value $value -Option AllScope
|
||||
$Alias = ($PSItem -split ",")[0]
|
||||
$value = ($PSItem -split ",")[1]
|
||||
Set-Alias -Name $Alias -Value $value -Option AllScope
|
||||
}
|
||||
|
||||
$env:POWERSHELL_TELEMETRY_OPTOUT = 1
|
||||
@@ -32,10 +32,12 @@ $tokens = @(
|
||||
}
|
||||
)
|
||||
|
||||
function unlockbw {
|
||||
function unlockbw
|
||||
{
|
||||
$env:BW_SESSION = "$(bw unlock --raw)"
|
||||
|
||||
foreach ($token in $tokens) {
|
||||
foreach ($token in $tokens)
|
||||
{
|
||||
Set-Variable -Name $token.name -Value $(bw get password $token.value) -Scope script
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
||||
"blocks": [
|
||||
{
|
||||
"segments": [
|
||||
{
|
||||
"foreground": "#00C5C7",
|
||||
"properties": {
|
||||
"time_format": "15:04:05"
|
||||
},
|
||||
"style": "plain",
|
||||
"template": " {{ .CurrentDate | date .Format }} ",
|
||||
"type": "time"
|
||||
}
|
||||
],
|
||||
"type": "rprompt"
|
||||
},
|
||||
{
|
||||
"alignment": "left",
|
||||
"segments": [
|
||||
{
|
||||
"foreground": "#77E4F7",
|
||||
"properties": {
|
||||
"style": "full"
|
||||
},
|
||||
"style": "plain",
|
||||
"template": "{{ .Path }} ",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"foreground": "#FFE700",
|
||||
"style": "plain",
|
||||
"template": "{{ .HEAD }} ",
|
||||
"type": "git"
|
||||
},
|
||||
{
|
||||
"foreground": "#43D426",
|
||||
"style": "plain",
|
||||
"template": "\u276f ",
|
||||
"type": "text"
|
||||
}
|
||||
],
|
||||
"type": "prompt"
|
||||
}
|
||||
],
|
||||
"version": 2
|
||||
}
|
||||
Reference in New Issue
Block a user