install.fairie/home/dot_config/powershell/profile.ps1
Brian Zalewski bafd6edca7 Latest
2023-06-10 00:56:25 +00:00

42 lines
1.3 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
# The specified module 'PSFzf' was not loaded because no valid module file was found in any module directory.
# 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
}