Skip to content

Instantly share code, notes, and snippets.

@justanindieguy
Created December 26, 2023 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justanindieguy/ceef944c8c2f47eebf85024a40ba5347 to your computer and use it in GitHub Desktop.
Save justanindieguy/ceef944c8c2f47eebf85024a40ba5347 to your computer and use it in GitHub Desktop.
Powershell config
# Load prompt config
function Get-ScriptDirectory { Split-Path $MyInvocation.ScriptName }
# Icons
Import-Module -Name Terminal-Icons
# PSReadLine
Set-PSReadLineOption -EditMode Emacs
Set-PSReadLineOption -BellStyle None
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineKeyHandler -Chord 'Ctrl+d' -Function DeleteChar
# Fzf
Import-Module PSFzf
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+f' -PSReadlineChordReverseHistory 'Ctrl+r'
# Alias
Set-Alias vim nvim
Set-Alias l ls
Set-Alias g git
Set-Alias grep findstr
Set-Alias tig 'C:\Program Files\Git\usr\bin\tig.exe'
Set-Alias less 'C:\Program Files\Git\usr\bin\less.exe'
# Oh My Posh!
oh-my-posh init pwsh --config 'C:\Users\Emmanuel\.mintimb.omp.json' | Invoke-Expression
# Utilities
function which ($command) {
Get-Command -Name $command -ErrorAction SilentlyContinue |
Select-Object -ExpandProperty Path -ErrorAction SilentlyContinue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment