From d275c33632271bf9cdbc01ef005deb9ff851370b Mon Sep 17 00:00:00 2001 From: sigoden Date: Sat, 2 Mar 2024 08:07:06 +0000 Subject: chore: move integration scripts --- scripts/shell-integration/integration.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 scripts/shell-integration/integration.ps1 (limited to 'scripts/shell-integration/integration.ps1') diff --git a/scripts/shell-integration/integration.ps1 b/scripts/shell-integration/integration.ps1 new file mode 100644 index 0000000..6a94189 --- /dev/null +++ b/scripts/shell-integration/integration.ps1 @@ -0,0 +1,10 @@ +Set-PSReadLineKeyHandler -Chord "alt+e" -ScriptBlock { + $_old = $null + [Microsoft.PowerShell.PSConsoleReadline]::GetBufferState([ref]$_old, [ref]$null) + if ($_old) { + [Microsoft.PowerShell.PSConsoleReadLine]::Insert('⌛') + $_new = (aichat -e $_old) + [Microsoft.PowerShell.PSConsoleReadLine]::DeleteLine() + [Microsoft.PowerShell.PSConsoleReadline]::Insert($_new) + } +} \ No newline at end of file -- cgit v1.2.3