-
Hi, I don't want to disable showing all dot files, but just ignore For example, if I want to use this command finders = {
own = {
command = function(directory)
local command = "rg --files --hidden --follow --no-ignore -g '!{node_modules,.git,**/_build,deps,.elixir_ls,**/target,**/assets/node_modules,**/assets/vendor,**/.next,**/.vercel,**/build,**/out}'"
local drop = 0
return command, drop
end,
max_files = 100000,
} Then how can I use the custom "own" finder? Finally, is there away to just use the built-in Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I think you've found a gap in the docs; or at least, the reference to custom finders is perhaps not obvious enough... I have an example of how to do this in my dotfiles: local has_commandt, commandt = pcall(require, 'wincent.commandt')
if has_commandt then
commandt.setup({
-- Demo: showing how to set up arbitrary command scanner that runs
-- `ack -f --print0`. See accompanying `:CommandTAck` definition below.
finders = {
ack = {
command = function(directory)
pushd(directory)
local command = 'ack -f --print0'
local drop = 0
return command, drop
end,
max_files = 100000,
on_close = popd,
on_directory = get_directory,
open = on_open,
},
},
})
vim.api.nvim_create_user_command('CommandTAck', function(command)
require('wincent.commandt').finder('ack', command.args)
end, {
complete = 'dir',
nargs = '?',
})
end
Not at this time. I haven't wanted to roll out a bunch of configuration options hot on the heels of the rewrite, but rather wanted to gather feedback and experience with the kind of modifications that people want to make. For now, the horrible-and-ghastly way to override a built-in finder is to look at how they are implemented and effectively fork them by copy-pasting them into your Having said that, the Ripgrep scanner may come very close to doing what you want out of the box. It will already ignore |
Beta Was this translation helpful? Give feedback.
-
For future you can also use a project specific .ignore on top of the .gitignore. They're almost never tracked so adding .ignore to global git ignore is mostly okay and it lets you keep a second list of ignored (but tracked) stuff that most tooling recognises (rg, etc). |
Beta Was this translation helpful? Give feedback.
I think you've found a gap in the docs; or at least, the reference to custom finders is perhaps not obvious enough... I have an example of how to do this in my dotfiles: