pwsh: starship

This commit is contained in:
2024-11-14 03:13:44 -05:00
parent 10092648ce
commit 5f8c1f1bb5

View File

@@ -1,14 +1,14 @@
# Automatically install oh-my-posh
if (-not (Test-Path "$env:LOCALAPPDATA\Programs\oh-my-posh\bin\oh-my-posh.exe")) {
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") # https://stackoverflow.com/a/31845512
$env:POSH_INSTALLER = "manual"
$env:POSH_THEMES_PATH = "$env:LOCALAPPDATA\Programs\oh-my-posh\themes"
}
#if (-not (Test-Path "$env:LOCALAPPDATA\Programs\oh-my-posh\bin\oh-my-posh.exe")) {
# Set-ExecutionPolicy Bypass -Scope Process -Force
# Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
# $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") # https://stackoverflow.com/a/31845512
# $env:POSH_INSTALLER = "manual"
# $env:POSH_THEMES_PATH = "$env:LOCALAPPDATA\Programs\oh-my-posh\themes"
#}
# oh-my-posh initialization
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/agnoster.minimal.omp.json" | Invoke-Expression
#oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/agnoster.minimal.omp.json" | Invoke-Expression
# Shortcut to edit the hosts file
function hosts {
@@ -16,10 +16,10 @@ function hosts {
}
# Update Oh-My-Posh
function Update-OhMyPosh {
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
}
#function Update-OhMyPosh {
# Set-ExecutionPolicy Bypass -Scope Process -Force
# Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
#}
# Set alias to vim to bypass batch file launcher, allows UNC editing
Set-Alias -Name vim -Value 'C:\Program Files\Vim\vim91\vim.exe'
@@ -29,3 +29,5 @@ $ETSN_MD = New-Object System.Management.Automation.CommandMetaData (Get-Command
$ETSN_MD.DefaultParameterSetName = "SSHHost"
"function Enter-PSSession { " + [System.Management.Automation.ProxyCommand]::Create($ETSN_MD) + " }" | Invoke-Expression
Remove-Variable ETSN_MD
Invoke-Expression (&starship init powershell)