formatter "path.filename_first" needs different filter than display #1247
Replies: 6 comments 3 replies
-
You're correct, currently the format of the string is "backwards", file first and then the folder which results in the behavior you're describing. Althought what you're desribing is desireable I'd have to check if this is possible as you need a delimiter which isn't part of anywhere else in the string to make this work, you can't use a path separator or |
Beta Was this translation helpful? Give feedback.
-
This doesn't seem possible with fzf as echo "a/b/c/d.txt" | fzf Now with: echo "a/b/c/d.txt" | fzf --delimiter="/" --with-nth="4,1..-2" |
Beta Was this translation helpful? Give feedback.
-
I am thinking about something like this:
BUT it seems |
Beta Was this translation helpful? Give feedback.
-
@Grueslayer, FYI, see junegunn/fzf#3854, hopefully the maintainer will consider this scenario. |
Beta Was this translation helpful? Give feedback.
-
@Grueslayer, with the latest commit you can now use the experimental v2 of the formatter: :lua require("fzf-lua").files({ formatter={"path.filename_first",2} })
-- or
:FzfLua files formatter={"path.filename_first",2}
-- via setup, applied to all
:lua require("fzf-lua").setup({ defaults = { formatter={"path.filename_first",2} } }) Ref: #1255 (comment) |
Beta Was this translation helpful? Give feedback.
-
@ibhagwan that seem to work much better. Highlighting of the chars matching the fuzzy word does not work if it is part of path and filename. But I think this isn’t possible without implementing it directly in fzf. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I can not get this running like (I think) it should work.
Let's assume you've following files
and you go with files and type
srcfile1
you get an empty list intead all file1.txt in all src subfolders (excluding the file1.txt in the doc subdirs)To make this run the "right" way I think you have to make
fd
(rg
) creating three columns:and use
--with-nth = 1,2
and--nth = 3
so 1+2 are displayed and 3 is filtered.Beta Was this translation helpful? Give feedback.
All reactions