Default command outputs relative filepath for preview to work in Windows#971
Default command outputs relative filepath for preview to work in Windows#971janlazo wants to merge 3 commits intojunegunn:masterfrom
Conversation
|
The following command removes the current directory of the path to display relative paths cmd.exe /q/V:ON/c "for /f %A in ('dir /s/b/a:-d-h 2^> nul') DO set RELPATH=%A & echo !RELPATH:%cd%\=!"/q is for If there are no files, an error appears so redirection to |
- use dir for file/path completion (see junegunn/fzf#971) - double-quote shell args via 'set noshellslash' for cmd.exe
|
#971 (comment) is necessary to omit network drive for the preview. |
4270263 to
1a9d09a
Compare
|
@junegunn Can you test if it works for you? I compiled using mingw32-make.exe from http://tdm-gcc.tdragon.net/download You can test it out in fzf.vim after forcing forward slashes (or escaping the backslash) on the filepath of the preview script Edit: |
|
I give on this. |
|
I see, thanks for looking into it.
Many users of fzf on *nix use |
|
From my previous note about powershell for relative paths, I recommend rg because of UTF-16 support and sift because only the prebuilt binary is required. |
|
It would be great if you could mention your findings here: https://github.com/junegunn/fzf/wiki/Windows |
Modified the default command in Windows to match the description in the README