Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
bbd7660c0a | ||
|
c35e62cc96 |
@ -6,12 +6,14 @@ Import-Module posh-git
|
|||||||
$env:POSH_GIT_ENABLED = $true
|
$env:POSH_GIT_ENABLED = $true
|
||||||
$env:VIRTUAL_ENV_DISABLE_PROMPT = "True"
|
$env:VIRTUAL_ENV_DISABLE_PROMPT = "True"
|
||||||
|
|
||||||
|
|
||||||
oh-my-posh init pwsh --config (Join-Path $profile_folder theme.omp.json) | Invoke-Expression
|
oh-my-posh init pwsh --config (Join-Path $profile_folder theme.omp.json) | Invoke-Expression
|
||||||
|
|
||||||
Import-Module posh-ssh
|
Import-Module posh-ssh
|
||||||
Import-Module posh-venv
|
Import-Module posh-venv
|
||||||
Import-Module DockerCompletion
|
Import-Module DockerCompletion
|
||||||
|
Import-Module Set-PsEnv
|
||||||
|
|
||||||
|
Enable-Dotenv
|
||||||
|
|
||||||
Set-PSReadLineOption -PredictionSource History
|
Set-PSReadLineOption -PredictionSource History
|
||||||
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
|
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
|
||||||
@ -20,18 +22,6 @@ Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
|
|||||||
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
|
Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete
|
||||||
Set-PSReadlineOption -BellStyle None
|
Set-PSReadlineOption -BellStyle None
|
||||||
|
|
||||||
if (Get-Command winget -ErrorAction SilentlyContinue) {
|
|
||||||
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
|
|
||||||
param($wordToComplete, $commandAst, $cursorPosition)
|
|
||||||
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
|
|
||||||
$Local:word = $wordToComplete.Replace('"', '""')
|
|
||||||
$Local:ast = $commandAst.ToString().Replace('"', '""')
|
|
||||||
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
|
|
||||||
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# kube / helm
|
# kube / helm
|
||||||
if (Get-Command kubectl -ErrorAction SilentlyContinue) {
|
if (Get-Command kubectl -ErrorAction SilentlyContinue) {
|
||||||
kubectl completion powershell | Out-String | Invoke-Expression
|
kubectl completion powershell | Out-String | Invoke-Expression
|
||||||
@ -41,7 +31,6 @@ if (Get-Command helm -ErrorAction SilentlyContinue) {
|
|||||||
helm completion powershell | Out-String | Invoke-Expression
|
helm completion powershell | Out-String | Invoke-Expression
|
||||||
}
|
}
|
||||||
|
|
||||||
# Gitlab CLI
|
|
||||||
if (Get-Command glab -ErrorAction SilentlyContinue) {
|
if (Get-Command glab -ErrorAction SilentlyContinue) {
|
||||||
glab completion -s powershell | Out-String | Invoke-Expression
|
glab completion -s powershell | Out-String | Invoke-Expression
|
||||||
}
|
}
|
||||||
|
@ -36,12 +36,12 @@ function venv {
|
|||||||
if (Test-Path "$env:WORKON_HOME/$venv/Scripts/activate.ps1") {
|
if (Test-Path "$env:WORKON_HOME/$venv/Scripts/activate.ps1") {
|
||||||
& "$env:WORKON_HOME/$venv/Scripts/activate.ps1"
|
& "$env:WORKON_HOME/$venv/Scripts/activate.ps1"
|
||||||
}
|
}
|
||||||
elseif ((!$venv -Or !$venv.Trim()) -And (Test-Path "venv/Scripts/activate.ps1")) {
|
|
||||||
& "venv/Scripts/activate.ps1"
|
|
||||||
}
|
|
||||||
elseif (Test-Path (Join-Path $PWD $venv)) {
|
elseif (Test-Path (Join-Path $PWD $venv)) {
|
||||||
& "$venv/Scripts/activate.ps1"
|
& "$venv/Scripts/activate.ps1"
|
||||||
}
|
}
|
||||||
|
elseif ((!$venv -Or !$venv.Trim()) -And (Test-Path "venv/Scripts/activate.ps1")) {
|
||||||
|
& "venv/Scripts/activate.ps1"
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
Write-Error "Environment '${venv}' does not exists."
|
Write-Error "Environment '${venv}' does not exists."
|
||||||
}
|
}
|
||||||
@ -51,10 +51,6 @@ function venv {
|
|||||||
deactivate
|
deactivate
|
||||||
}
|
}
|
||||||
|
|
||||||
"list-python" {
|
|
||||||
py -0 | Select-Object -Skip 1
|
|
||||||
}
|
|
||||||
|
|
||||||
default {
|
default {
|
||||||
Write-Error "Unknown venv command ${args[0]}."
|
Write-Error "Unknown venv command ${args[0]}."
|
||||||
}
|
}
|
||||||
|
138
theme.omp.json
138
theme.omp.json
@ -1,86 +1,97 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
|
||||||
"version": 2,
|
|
||||||
"final_space": true,
|
|
||||||
"blocks": [
|
"blocks": [
|
||||||
{
|
{
|
||||||
"type": "prompt",
|
|
||||||
"alignment": "left",
|
"alignment": "left",
|
||||||
"segments": [
|
"segments": [
|
||||||
{
|
{
|
||||||
"type": "root",
|
|
||||||
"style": "plain",
|
|
||||||
"foreground": "#ffee58",
|
"foreground": "#ffee58",
|
||||||
"template": " \uf0e7 "
|
"style": "plain",
|
||||||
|
"template": " \uf0e7 ",
|
||||||
|
"type": "root"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "exit",
|
|
||||||
"style": "powerline",
|
|
||||||
"foreground": "#06884b",
|
"foreground": "#06884b",
|
||||||
"foreground_templates": ["{{ if gt .Code 0 }}#e61010{{ end }}"],
|
"foreground_templates": ["{{ if gt .Code 0 }}#e61010{{ end }}"],
|
||||||
"template": " {{ if gt .Code 0 }}✗{{ else }}✔{{ end }} ",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"always_enabled": true
|
"always_enabled": true
|
||||||
}
|
},
|
||||||
|
"style": "powerline",
|
||||||
|
"template": " {{ if gt .Code 0 }}\u2717{{ else }}\u2714{{ end }} ",
|
||||||
|
"type": "exit"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "session",
|
"foreground": "#ffffff",
|
||||||
"style": "plain",
|
|
||||||
"foreground": "#ddd",
|
|
||||||
"template": " {{ if .SSHSession }}\udb80\udf18 {{ end }}{{ .UserName }}{{ if .SSHSession }}@{{ .HostName }}{{ end }}",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"display_host": false
|
"display_host": false
|
||||||
|
},
|
||||||
|
"style": "plain",
|
||||||
|
"template": " {{ if .SSHSession }}\uf817 {{ end }}{{ .UserName }}",
|
||||||
|
"type": "session"
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
]
|
"type": "prompt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "prompt",
|
|
||||||
"alignment": "left",
|
"alignment": "left",
|
||||||
"segments": [
|
"segments": [
|
||||||
{
|
{
|
||||||
"type": "go",
|
"foreground": "#fff000",
|
||||||
|
"properties": {
|
||||||
|
"prefix": " \ufcb5 ",
|
||||||
|
"var_name": "__SHELL_INFORMATION_POSH_258__"
|
||||||
|
},
|
||||||
"style": "powerline",
|
"style": "powerline",
|
||||||
"foreground": "#ffffff",
|
"type": "envvar"
|
||||||
"background": "#983ebb",
|
|
||||||
"template": " \udb81\udfd3 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} "
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "python",
|
"foreground": "#b600ff",
|
||||||
"style": "powerline",
|
"style": "powerline",
|
||||||
"powerline_symbol": "\ue0b0",
|
"template": " \ufcd1 {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} ",
|
||||||
|
"type": "go"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"foreground": "#b600ff",
|
||||||
|
"style": "powerline",
|
||||||
|
"template": " \ue718 {{ if .PackageManagerIcon }}{{ .PackageManagerIcon }} {{ end }}{{ .Full }} ",
|
||||||
|
"type": "node"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"background": "#b600ff",
|
||||||
"foreground": "#ffffff",
|
"foreground": "#ffffff",
|
||||||
"background": "#983ebb",
|
"powerline_symbol": "\ue0b0",
|
||||||
"template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"display_mode": "context",
|
"display_mode": "context",
|
||||||
"home_enabled": true
|
"home_enabled": true
|
||||||
|
},
|
||||||
|
"style": "powerline",
|
||||||
|
"template": " \ue235 {{ if .Error }}{{ .Error }}{{ else }}{{ if .Venv }}{{ .Venv }} {{ end }}{{ .Full }}{{ end }} ",
|
||||||
|
"type": "python"
|
||||||
}
|
}
|
||||||
}
|
],
|
||||||
]
|
"type": "prompt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "prompt",
|
|
||||||
"alignment": "left",
|
"alignment": "left",
|
||||||
"segments": [
|
"segments": [
|
||||||
{
|
{
|
||||||
"type": "os",
|
|
||||||
"style": "plain",
|
|
||||||
"foreground": "#8e24aa",
|
"foreground": "#8e24aa",
|
||||||
"template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} "
|
"style": "plain",
|
||||||
|
"template": " {{ if .WSL }}WSL at {{ end }}{{.Icon}} ",
|
||||||
|
"type": "os"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "path",
|
"background": "#0037da",
|
||||||
"style": "powerline",
|
|
||||||
"powerline_symbol": "\ue0b0",
|
|
||||||
"foreground": "#ffffff",
|
"foreground": "#ffffff",
|
||||||
"background": "#3156c4",
|
"powerline_symbol": "\ue0b0",
|
||||||
"template": " {{ .Path }} ",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"folder_separator_icon": " \ue0b1 ",
|
"folder_separator_icon": " \ue0b1 ",
|
||||||
"home_icon": "\uf015 ",
|
"home_icon": "\uf7db",
|
||||||
"style": "letter"
|
"style": "letter"
|
||||||
}
|
},
|
||||||
|
"style": "powerline",
|
||||||
|
"template": " {{ .Path }} ",
|
||||||
|
"type": "path"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@ -104,46 +115,49 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"type": "prompt"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "rprompt",
|
|
||||||
"alignment": "right",
|
"alignment": "right",
|
||||||
"segments": [
|
"segments": [
|
||||||
{
|
{
|
||||||
"type": "executiontime",
|
|
||||||
"style": "plain",
|
|
||||||
"powerline_symbol": "\ue0b0",
|
|
||||||
"foreground": "#8454bb",
|
"foreground": "#8454bb",
|
||||||
"template": " <#fefefe>\udb81\udead</> {{ .FormattedMs }} ",
|
"powerline_symbol": "\ue0b0",
|
||||||
"properties": {
|
"properties": {
|
||||||
"style": "austin",
|
"style": "austin",
|
||||||
"threshold": 500
|
"threshold": 500
|
||||||
}
|
},
|
||||||
|
"style": "plain",
|
||||||
|
"template": " <#fefefe>\ufbab</> {{ .FormattedMs }} ",
|
||||||
|
"type": "executiontime"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "time",
|
|
||||||
"style": "plain",
|
|
||||||
"foreground": "#007ACC",
|
"foreground": "#007ACC",
|
||||||
"template": " {{ .CurrentDate | date .Format }} ",
|
|
||||||
"properties": {
|
"properties": {
|
||||||
"time_format": "[15:04:05]"
|
"time_format": "[15:04:05]"
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
"style": "plain",
|
||||||
"type": "prompt",
|
"template": " {{ .CurrentDate | date .Format }} ",
|
||||||
"alignment": "left",
|
"type": "time"
|
||||||
"segments": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"style": "powerline",
|
|
||||||
"foreground": "#3156c4",
|
|
||||||
"template": " \u276f "
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"newline": true
|
"type": "rprompt"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"alignment": "left",
|
||||||
|
"newline": true,
|
||||||
|
"segments": [
|
||||||
|
{
|
||||||
|
"foreground": "#0037da",
|
||||||
|
"style": "powerline",
|
||||||
|
"template": " \u276f ",
|
||||||
|
"type": "text"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"type": "prompt"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"final_space": true,
|
||||||
|
"version": 2
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user