Skip to content

Instantly share code, notes, and snippets.

@jhoneill
Last active May 25, 2023 10:54
Show Gist options
  • Save jhoneill/cd5a7114335d25cb8f0b6281bf73fb83 to your computer and use it in GitHub Desktop.
Save jhoneill/cd5a7114335d25cb8f0b6281bf73fb83 to your computer and use it in GitHub Desktop.
Set-PSReadlineOption -PredictionSource History
Set-PSReadlineOption -BellStyle None -EditMode Windows -WordDelimiters "`~!£#%^&*()=+[{]}\|;:'`",.<>/?"
Set-PSReadLineOption -Colors @{'Parameter'= "$([char]27)[97m"; 'operator'= "$([char]27)[97m"} #defaults are too dark use $([char]27) because `e doesn't work on PS 5.
Set-PSReadLineKeyHandler -Key Ctrl+RightArrow -ScriptBlock {
param($key, $arg)
$line = $null
$cursor = $null
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
if ($cursor -lt $line.Length) {
[Microsoft.PowerShell.PSConsoleReadLine]::ForwardWord($key, $arg)
}
else {[Microsoft.PowerShell.PSConsoleReadLine]::AcceptNextSuggestionWord($key, $arg)}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment