* Use `-print-last-dir` option for `lfcd.ps1` * chore(etc/lfcd.ps1): use `Set-Location` instead of `cd` Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com> --------- Co-authored-by: Joe Lim <50560759+joelim-work@users.noreply.github.com>
17 lines
559 B
PowerShell
17 lines
559 B
PowerShell
# 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:
|
|
#
|
|
# Set-PSReadLineKeyHandler -Chord Ctrl+o -ScriptBlock {
|
|
# [Microsoft.PowerShell.PSConsoleReadLine]::RevertLine()
|
|
# [Microsoft.PowerShell.PSConsoleReadLine]::Insert('lfcd.ps1')
|
|
# [Microsoft.PowerShell.PSConsoleReadLine]::AcceptLine()
|
|
# }
|
|
#
|
|
# You may put this in one of the profiles found in $PROFILE.
|
|
#
|
|
|
|
lf -print-last-dir $args | Set-Location
|