m/fzf
1
0
mirror of https://github.com/junegunn/fzf.git synced 2025-11-18 00:03:39 -05:00

Add Relative Filepaths section for setting FZF_DEFAULT_COMMAND

Jan Edmund Lazo
2017-08-20 18:37:53 -04:00
parent 02bc29d973
commit 4f6666346c

@@ -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