diff --git a/Windows.md b/Windows.md index 49ea57c..8e4c2ab 100644 --- a/Windows.md +++ b/Windows.md @@ -6,6 +6,20 @@ flawlessly. [bin]: https://github.com/junegunn/fzf-bin/releases [wsl]: https://blogs.msdn.microsoft.com/wsl/ +### Relative Filepaths + +fzf uses `dir /s/b` as its default command for performance but it outputs absolute filepaths. +To use relative filepaths, set `FZF_DEFAULT_COMMAND` to any of the following and run it cmd.exe because it is faster than powershell.exe: + +- cmd.exe https://github.com/junegunn/fzf/pull/971#issuecomment-313971408 +```dosbatch +cmd.exe /q/V:ON/c "for /f %A in ('dir /s/b 2^> nul') do set RELPATH=%A & echo !RELPATH:%cd%\=!" +``` +- powershell https://github.com/junegunn/fzf/issues/960 +```dosbatch +powershell.exe -NoLogo -NoProfile -Noninteractive -Command "Get-ChildItem -File -Recurse -Name" +``` + ### PowerShell support https://github.com/kelleyma49/PSFzf \ No newline at end of file