powershell

This commit is contained in:
2022-10-30 19:18:59 -05:00
parent 9c9229966d
commit 0cb792d780
3 changed files with 79 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
clear-host
oh-my-posh init pwsh --config ~/.config/powershell/config.json | 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"
) | ForEach-Object {
$Alias = ($PSItem -split ",")[0]
$value = ($PSItem -split ",")[1]
Set-Alias -Name $Alias -Value $value -Option AllScope
}
$env:POWERSHELL_TELEMETRY_OPTOUT = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1

View File

@@ -0,0 +1,50 @@
{
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json",
"blocks": [
{
"alignment": "right",
"segments": [
{
"foreground": "#00C5C7",
"properties": {
"time_format": "15:04:05"
},
"style": "plain",
"template": " {{ .CurrentDate | date .Format }} ",
"type": "time"
}
],
"type": "prompt",
"vertical_offset": -1
},
{
"alignment": "left",
"newline": true,
"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
}

View File

@@ -26,4 +26,6 @@ dconf:
configs:
- {src: 'terminator', dest: 'terminator', destname: 'config'}
- {src: 'Microsoft.PowerShell_profile.ps1', dest: 'powershell', destname: 'Microsoft.PowerShell_profile.ps1'}
- {src: 'pwsh-config.json', dest: 'powershell', destname: 'config.json'}