nvim-telescope / telescope-project.nvim

MIT License
602 stars 54 forks source link

Search Ignored Files #66

Open athomasoriginal opened 3 years ago

athomasoriginal commented 3 years ago

Hey there and thanks for the work on this extension!

How can we tell the find files while in project search to include git ignored files? I see that this extension seems to use the find_files built-in under the hood, but it doesn't allow us to pass in additional configuration? (i'm new at lua; apologies if it can and i'm missing it).

Here is an example of the type of arguments I would like to pass to find_files:

find_command=rg,--files,-uu

Example usage in Telescope:

nnoremap <leader>ff <cmd>Telescope find_files find_command=rg,--files,-uu<cr>

My current workaround is I use Telescope project to change into the project dir, exit, and then do a Telescope find_files.

Thanks again!

matu3ba commented 3 years ago

~~You can call from vimscript a lua function that sets hidden_files accordingly to get the correct search. So something like nnoremap <leader>ff <cmd>Mytelefind :lua local var=toString(find_files_ignore(string(<q-args>)) should work. Otherwise using a local variable might do the trick. Something along .. Mytelefind g:tmp=string(<q-args>); :lua local var=tmp; Mytelefind() If you get this running: Can you suggest a minimal example how to read the command variables in lua for the nvim-lua-guide?~~

UPDATE: You need to define your own command in vimscript and handle the arguments accordingly to call the respective telescope function with forwarding the correct arguments.

athomasoriginal commented 3 years ago

Hey there @matu3ba! I read over the suggestion crossed out and the issue linked, but I'm not sure I understand what the suggestion is. 🤔

matu3ba commented 3 years ago

@athomasoriginal The suggestion is to create a vim command and use fargs (see :help f-args) or use a keybinding for calling the vim function. Alternatively you can write a custom lua function and call it via keybinding.