-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Default command outputs relative filepath for preview to work in Windows #971
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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