diff --git a/dotposh/Config/posh-git.ps1 b/dotposh/Config/posh-git.ps1 index 321e2c8..0e1ede0 100644 --- a/dotposh/Config/posh-git.ps1 +++ b/dotposh/Config/posh-git.ps1 @@ -11,19 +11,27 @@ if (-not (Get-Module -ListAvailable -Name git-aliases -ErrorAction SilentlyConti if (Get-Command scoop -ErrorAction SilentlyContinue) { if (!($(scoop bucket list).Name -eq "extras")) { scoop bucket add extras } scoop install git-aliases - } - else { + } else { Install-Module git-aliases -Scope CurrentUser -Force } } Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -MaxTriggerCount 1 -Action { Import-Module git-aliases -Global -DisableNameChecking } | Out-Null +# lazygit alias +if (Get-Command lazygit -ErrorAction SilentlyContinue) { + Set-Alias -Name 'lg' -Value 'lazygit' +} + # github cli if (Get-Command gh -ErrorAction SilentlyContinue) { - Invoke-Expression -Command $(gh completion -s powershell | Out-String) + Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -MaxTriggerCount 1 -Action { + Invoke-Expression -Command $(gh completion -s powershell | Out-String) + } | Out-Null } # gitleaks if (Get-Command gitleaks -ErrorAction SilentlyContinue) { - gitleaks completion powershell | Out-String | Invoke-Expression -} \ No newline at end of file + Register-EngineEvent -SourceIdentifier PowerShell.OnIdle -MaxTriggerCount 1 -Action { + gitleaks completion powershell | Out-String | Invoke-Expression + } | Out-Null +}