From ff6b35411a0dfdfd0b367f85d81d24531bfe9446 Mon Sep 17 00:00:00 2001 From: Ibrahim Muftee Date: Wed, 19 Jun 2024 14:42:39 -0500 Subject: feat(powershell): add some aliases --- dot_config/powershell/Microsoft.PowerShell_profile.ps1 | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'dot_config/powershell') diff --git a/dot_config/powershell/Microsoft.PowerShell_profile.ps1 b/dot_config/powershell/Microsoft.PowerShell_profile.ps1 index 86e788e..6a006de 100644 --- a/dot_config/powershell/Microsoft.PowerShell_profile.ps1 +++ b/dot_config/powershell/Microsoft.PowerShell_profile.ps1 @@ -23,5 +23,14 @@ Set-PSReadlineKeyHandler -Key "Ctrl+f" -ScriptBlock { [System.Windows.Forms.SendKeys]::SendWait("{ENTER}") } +# Aliases +if (Get-Command -Name 'nvim' -CommandType 'Application' -ErrorAction SilentlyContinue) { + if (Get-Command -Name 'poetry' -CommandType 'Application' -ErrorAction SilentlyContinue) { + # Can't create an "alias" with CLI args + function pn() { & poetry run nvim . } + function prun() { & poetry run } + } +} + # Load Starship prompt Invoke-Expression (&starship init powershell) -- cgit v1.2.3