How do I create a custom telescope picker able to take the search-path in the prompt itself? #3684
Unanswered
Akshit-Anand-008
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I saw TJ DeVries's video regarding advanced telescope usage and built a file navigator (fileseek function in the lua script) very similar (Took AI help).
Intended behaviour: Split the prompt into 2 parts using double spaces as delimiter. Use the first part to fuzzy find file and second to specify directory to search.
Problem: I have to use
fdwith which I can't fuzzy find, I have to write exact name. Also, If I add any sorters, I can't get proper results as it uses the second part of the prompt as well for sorting and therefore, I have to disable it. It basically gives results in very bad search order. How can I fix these 2 issues:Enable fuzzy finding
Sort the results
What my script does: Create a table
args = {"fd", "-t" , "f"}Splits the prompt into 2 pieces, insert the first one into args if second piece exists then insert 2nd piece with--search-pathinto args.h means search in home directory;w means search in my ~/Notebooks directory;r means search relative to file path and not cwd;each . added moves the one directory backreturn {
"nvim-telescope/telescope.nvim",
dependencies = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
},
}
All reactions