internal/keybindings/copyAll.ps1

1
2
3
4
5
6
7
8
9
10
11
#region CTRL+SHIFT+C : Copy all lines of the current command to clipboard
Set-PSReadlineKeyHandler -Chord Ctrl+Shift+c -BriefDescription CopyAllLines -Description "Copies the all lines of the current command into the clipboard" -ScriptBlock {
    
    # Get current code
    $line = $null
    [Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$null)
    
    # Paste it to clipboard
    Set-Clipboard $line
}
#endregion CTRL+SHIFT+C : Copy all lines of the current command to clipboard