todo-comments.nvim icon indicating copy to clipboard operation
todo-comments.nvim copied to clipboard

Add option for :TodoTelescope to ignore dirs

Open Grazfather opened this issue 2 years ago • 2 comments

Did you check the docs?

  • [X] I have read all the todo-comments.nvim docs

Is your feature request related to a problem? Please describe.

TodoTelescope is useless in any Go project that vendors its deps because it shows the TODOs of all its deps

Describe the solution you'd like

Allow some ignore regex filepath, maybe. I could say I don't want it to search anything in vendor/

Describe alternatives you've considered

x

Additional context

No response

Grazfather avatar Aug 05 '23 05:08 Grazfather

This can usually be achieved through the command you're using to search for TODO comments. By default todo-comments uses ripgrep, so you can ignore directories with the --glob flag. In my case, I'm ignoring files in the lib/ directory:

{
  search = {
    command = "rg",
    args = {
      "--glob=!lib/",
    },
  },
}

Unfortunately, I've found I needed to include the default flags as well, otherwise the output wouldn't be formatted in the way todo-comments expects:

{
  search = {
    command = "rg",
    args = {
      "--glob=!lib/",
      "--color=never",
      "--no-heading",
      "--with-filename",
      "--line-number",
      "--column",
    },
  },
}

Benjman avatar Aug 15 '23 18:08 Benjman

This can usually be achieved through the command you're using to search for TODO comments. By default todo-comments uses ripgrep, so you can ignore directories with the --glob flag. In my case, I'm ignoring files in the lib/ directory:

{
  search = {
    command = "rg",
    args = {
      "--glob=!lib/",
    },
  },
}

Unfortunately, I've found I needed to include the default flags as well, otherwise the output wouldn't be formatted in the way todo-comments expects:

{
  search = {
    command = "rg",
    args = {
      "--glob=!lib/",
      "--color=never",
      "--no-heading",
      "--with-filename",
      "--line-number",
      "--column",
    },
  },
}

This solution is not working for me, I tried everything.

kumar-shivang avatar May 14 '24 09:05 kumar-shivang

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 06 '24 01:07 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jul 13 '24 01:07 github-actions[bot]