win-scripts/profile.ps1

49 lines
1.3 KiB
PowerShell
Raw Normal View History

2022-09-11 17:22:45 +02:00
using namespace System.Management.Automation
2022-02-26 10:33:50 +01:00
2021-12-05 16:12:47 +01:00
Import-Module PSReadLine
# Setting up PATH
$env:Path = "$HOME/Bin/system/;" + "$env:Path"
2022-09-23 16:10:20 +02:00
$env:Path = "$HOME/Bin/custom/;" + "$env:Path"
2021-12-05 16:12:47 +01:00
$versionMinimum = [Version]'7.1.999'
if (($Host.Name -eq 'ConsoleHost') -and ($PSVersionTable.PSVersion -ge $versionMinimum))
{
Set-PSReadLineOption -PredictionSource HistoryAndPlugin
}
else
{
Set-PSReadLineOption -PredictionSource History
}
Set-PSReadLineOption -HistorySearchCursorMovesToEnd
Set-PSReadLineKeyHandler -Key UpArrow -Function HistorySearchBackward
Set-PSReadLineKeyHandler -Key DownArrow -Function HistorySearchForward
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadlineOption -Color @{
"Command" = [ConsoleColor]::Green
"Parameter" = [ConsoleColor]::Gray
"Operator" = [ConsoleColor]::Magenta
"Variable" = [ConsoleColor]::White
"String" = [ConsoleColor]::Yellow
"Number" = [ConsoleColor]::Blue
"Type" = [ConsoleColor]::Cyan
"Comment" = [ConsoleColor]::DarkCyan
}
# Chocolatey profile
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}
function dl {
2022-02-26 10:33:50 +01:00
Set-Location ~\Downloads
2021-12-05 16:12:47 +01:00
aria2c -j 16 -s 16 -x 16 -k 5M --file-allocation=none $args[0]
}
New-Alias vi nvim-qt.exe
Invoke-Expression (&starship init powershell)