Skip to content

Custom scanner #422

Answered by wincent
idr4n asked this question in Q&A
Apr 3, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Then how can I use the custom "own" finder?

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)
          local command = 'ack -f --print0'
          if directory ~= '' and directory ~= '.' and directory ~= './' then
            directory = vim.fn.shellescape

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@wincent
Comment options

@idr4n
Comment options

Answer selected by idr4n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants