From 6324cfd7b024d1a4e36b20d5f0c295e4abc694dd Mon Sep 17 00:00:00 2001 From: Klesh Wong Date: Sun, 21 Mar 2021 18:09:58 +0800 Subject: [PATCH] [misc] lf for win --- cli/lf/lfrc.win | 5 +++++ win/profile.ps1 | 10 ++++++++++ 2 files changed, 15 insertions(+) diff --git a/cli/lf/lfrc.win b/cli/lf/lfrc.win index 897eb3f..8831d89 100644 --- a/cli/lf/lfrc.win +++ b/cli/lf/lfrc.win @@ -1,5 +1,10 @@ +set icons +set drawbox cmd mkdir %mkdir "$@" cmd fp %powershell -NoProfile -Command Set-Clipboard $env:f cmd fn %powershell -NoProfile -Command Set-Clipboard (Split-Path -Leaf ($env:f -replace '"','')) + + +map rename diff --git a/win/profile.ps1 b/win/profile.ps1 index 6fd1433..4cde92e 100644 --- a/win/profile.ps1 +++ b/win/profile.ps1 @@ -113,3 +113,13 @@ function pass-edit { Remove-Item $tmpfile.FullName -Force } } + +function f { + [Cmdletbinding()] + + $tmpfile = New-TemporaryFile + lf -last-dir-path $tmpfile + $lastdir = Get-Content $tmpfile + Remove-Item $tmpfile + cd $lastdir +}