Add PowerShell keybinding example for lfcd (#532)

* Add PowerShell keybinding example

* Update lfcd.ps1
This commit is contained in:
sitiom 2020-12-24 06:21:35 +08:00 committed by GitHub
parent de691bf4e8
commit e7f5f90b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,17 @@
# Change working dir in powershell to last dir in lf on exit. # 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 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() $tmp = [System.IO.Path]::GetTempFileName()
lf -last-dir-path="$tmp" $args lf -last-dir-path="$tmp" $args