install.fairie/home/dot_config/powershell/profile.ps1
Brian Zalewski 11a3fbb69e Latest
2023-06-10 00:54:02 +00:00

41 lines
1.2 KiB
PowerShell

### Env
$env:EDITOR = 'code --wait'
$env:GIT_SSH = "C:\Windows\system32\OpenSSH\ssh.exe"
### Set PowerShell to UTF-8
[console]::InputEncoding = [console]::OutputEncoding = New-Object System.Text.UTF8Encoding
### Oh My Posh
Install-Module posh-git
oh-my-posh init pwsh --config "$env:HOME/.config/oh-my-posh/Betelgeuse.omp.json" | Invoke-Expression
### Docker Completion
Import-Module "$env:HOME/.local/share/powershell/docker/DockerCompletion/DockerCompletion"
# Import-Module -Name Terminal-Icons
### PSReadLine
Set-PSReadLineOption -EditMode Vi
Set-PSReadLineOption -BellStyle None
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
Set-PSReadLineOption -PredictionSource History
### Fzf
# Note: This was not working under PowerShell via VSCode on macOS
# Import-Module PSFzf
# Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r'
### zoxide
Invoke-Expression (& {
$hook = if ($PSVersionTable.PSVersion.Major -lt 6) { 'prompt' } else { 'pwd' }
(zoxide init --hook $hook powershell | Out-String)
})
### Aliases
Set-Alias grep findstr
### Utilities
function which ($command) {
Get-Command -Name $command -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
}