Closed qizhengyang2017 closed 1 month ago
vim ../**
vim
works because it runs with:
FZF_DEFAULT_COMMAND= fzf --walker file,dir,follow,hidden --walker-root=..
cd
runs with:
FZF_DEFAULT_COMMAND= fzf --walker dir,follow --walker-root=..
This appears to be correct, but if the hidden
option is not enabled, it skips directories starting with a .
(dot), including ..
.
A potential fix could be:
--- a/src/reader.go
+++ b/src/reader.go
@@ -266,5 +266,5 @@ func (r *Reader) readFiles(root string, opts walkerOpts, ignores []string) bool
if isDir || opts.follow && isSymlinkToDir(path, de) {
base := filepath.Base(path)
- if !opts.hidden && base[0] == '.' {
+ if !opts.hidden && base != ".." && base[0] == '.' {
return filepath.SkipDir
}
Alternatively, you can use this workaround:
export FZF_COMPLETION_DIR_OPTS='--walker dir,follow,hidden'
If too many hidden folders are displayed, use the --walker-skip=DIRS
flag. Default values are explained in the CHANGELOG[^1] and fzf's
man page.
Thanks @LangLangBart, patch pushed to master.
Checklist
man fzf
)Output of
fzf --version
0.55.0 (brew)/ 0.55.0 (fc69308)
OS
Shell
Problem / Steps to reproduce
When using
vim ../**<TAB>
, I can match files in the parent directory, but when usingcd ../**<TAB>
, I can’t match the folders. Why is that?