diff --git a/profile.ps1 b/profile.ps1 index 16da369..57bf128 100644 --- a/profile.ps1 +++ b/profile.ps1 @@ -1,5 +1,5 @@ # Use Cmder's multiline prompt and posh-git. -Import-Module "$env:ChocolateyToolsLocation\\Cmder\\vendor\\profile.ps1" +Import-Module "$env:ChocolateyToolsLocation\Cmder\vendor\profile.ps1" # Enable Chocolatey completions. Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" @@ -12,16 +12,15 @@ $OutputEncoding = New-Object -typename System.Text.UTF8Encoding Set-PSReadLineOption -BellStyle None -EditMode Vi # Make C-w backward delete a word. Set-PSReadLineKeyHandler -Chord Ctrl+w -Function BackwardDeleteWord -# TODO: Doesn't work with PSReadLine 2.1 -# Hoping this gets fixed at some point and will just start working. -# Set-PSReadLineKeyHandler -Chord Ctrl+[ -Function ViCommandMode -# Workaournd from https://github.com/PowerShell/PSReadLine/issues/906#issuecomment-916847040 +# Make C-[ escape insert mode. +# https://github.com/PowerShell/PSReadLine/issues/906#issuecomment-916847040 Set-PSReadLineKeyHandler -Chord 'Ctrl+Oem4' -Function ViCommandMode +# Enable menu style tab completions. https://stackoverflow.com/a/37715242 +Set-PSReadlineKeyHandler -Key Tab -Function MenuComplete # Change cursor shape based on what Vi mode the line editor is in. -# Testing and works with PowerShell 5.1 +# Tested and works with PowerShell 5.1 # NOTE: Requires: Install-Module PsReadline -Scope CurrentUser -Force -# FIXME: Doesn't work with PSReadLine 2.0 function OnViModeChange { if ($args[0] -eq 'Command') { # Set the cursor to non-blinking block.