Compare commits

..

No commits in common. "56367b82f5b8cdd0604986211743244ed77f503a" and "0a9f004dc98458f78500191131466aa35ded7fdf" have entirely different histories.

View File

@ -1,9 +1,7 @@
# Use Cmder's multiline prompt and posh-git. # 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. # Enable Chocolatey completions.
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
# Enable op completions.
Import-Module "$env:LOCALAPPDATA\1Password\cli\opProfile.psm1"
# Set UTF-8 as the character set for pipes and output objects. # Set UTF-8 as the character set for pipes and output objects.
# https://gist.github.com/xoner/4671514 # https://gist.github.com/xoner/4671514
@ -14,15 +12,16 @@ $OutputEncoding = New-Object -typename System.Text.UTF8Encoding
Set-PSReadLineOption -BellStyle None -EditMode Vi Set-PSReadLineOption -BellStyle None -EditMode Vi
# Make C-w backward delete a word. # Make C-w backward delete a word.
Set-PSReadLineKeyHandler -Chord Ctrl+w -Function BackwardDeleteWord Set-PSReadLineKeyHandler -Chord Ctrl+w -Function BackwardDeleteWord
# Make C-[ escape insert mode. # TODO: Doesn't work with PSReadLine 2.1
# https://github.com/PowerShell/PSReadLine/issues/906#issuecomment-916847040 # 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
Set-PSReadLineKeyHandler -Chord 'Ctrl+Oem4' -Function ViCommandMode 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. # Change cursor shape based on what Vi mode the line editor is in.
# Tested and works with PowerShell 5.1 # Testing and works with PowerShell 5.1
# NOTE: Requires: Install-Module PsReadline -Scope CurrentUser -Force # NOTE: Requires: Install-Module PsReadline -Scope CurrentUser -Force
# FIXME: Doesn't work with PSReadLine 2.0
function OnViModeChange { function OnViModeChange {
if ($args[0] -eq 'Command') { if ($args[0] -eq 'Command') {
# Set the cursor to non-blinking block. # Set the cursor to non-blinking block.