Skip to content

Instantly share code, notes, and snippets.

@abdmmar
Created February 3, 2024 08:02
Show Gist options
  • Select an option

  • Save abdmmar/3282f14e4a73fcffb8f0c270f514f371 to your computer and use it in GitHub Desktop.

Select an option

Save abdmmar/3282f14e4a73fcffb8f0c270f514f371 to your computer and use it in GitHub Desktop.
PowerShell Profile that use oh-my-posh , terminal icons, autocomplete, history, and custom aliases
# Setup
## https://github.com/JanDeDobbeleer/oh-my-posh/blob/main/themes/zash.omp.json
oh-my-posh --init --shell pwsh --config ~/zash.omp.json | invoke-expression
# Modules
## Terminal-Icons
Import-Module -Name Terminal-Icons
Import-Module PSReadLine
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
# Aliases
## pnpm
function Set-PnpmExecute { & pnpm dlx $args}
Set-Alias pn pnpm
New-Alias -Name pnx -Value Set-PnpmExecute
## git
function Set-GitCommit { & git commit -m $args}
New-Alias -Name gcmm -Value Set-GitCommit
function Set-GitCommitNoVerify {& git commit -m --no-verify $args}
New-Alias -Name gcnm -Value Set-GitCommitNoVerify
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment