From e7f5f90b0c1270701fb24044ec66e25d78b7963f Mon Sep 17 00:00:00 2001 From: sitiom <56180050+sitiom@users.noreply.github.com> Date: Thu, 24 Dec 2020 06:21:35 +0800 Subject: [PATCH] Add PowerShell keybinding example for lfcd (#532) * Add PowerShell keybinding example * Update lfcd.ps1 --- etc/lfcd.ps1 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/etc/lfcd.ps1 b/etc/lfcd.ps1 index 0b54314..e128acd 100644 --- a/etc/lfcd.ps1 +++ b/etc/lfcd.ps1 @@ -1,6 +1,17 @@ # Change working dir in powershell to last dir in lf on exit. # # You need to put this file to a folder in $ENV:PATH variable. +# +# You may also like to assign a key to this command: +# +# You may put this in one of the profiles found in $PROFILE. +# +# Set-PSReadLineKeyHandler -Chord Ctrl+o -ScriptBlock { +# [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine() +# [Microsoft.PowerShell.PSConsoleReadLine]::Insert('lfcd.ps1') +# [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine() +# } +# $tmp = [System.IO.Path]::GetTempFileName() lf -last-dir-path="$tmp" $args