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

Show for current buffer

Open Integralist opened this issue 2 years ago • 5 comments

Does anyone know if it's possible to only see the items (todos/notes/warnings etc) for the current file?

This might be possible, but if so I couldn't tell from the README or the help documentation.

Thanks!

Integralist avatar Sep 29 '22 12:09 Integralist

I was looking for this as well, and can't find a way to do it. Looking through the source, I don't think this is currently possible. Can this be a feature request, where we can specify currbuf=true similar to cwd/keyword?

kagbodji avatar Jan 11 '23 20:01 kagbodji

I think you can achieve that with the solution from issue https://github.com/folke/todo-comments.nvim/issues/110.

Camille-Upway avatar May 17 '23 12:05 Camille-Upway

BTW this was what I ended up using...

vim.keymap.set("n", "<leader>da", "<Cmd>TodoTelescope<CR>", {desc = "search TODOs across all files"})
vim.keymap.set("n", "<leader>dc", "<Cmd>exe ':TodoQuickFix cwd=' .. fnameescape(expand('%:p'))<CR>", {desc = "search TODOs in current file"})

Integralist avatar Aug 04 '23 13:08 Integralist

Thanks for this @Integralist! I was looking for something like this too. Passing in the current file to the existing command on a key bind works great!

BTW for future ppl, if you also want a mapping to show trouble Diagnostics for the current buffer only, check out the Examples doc - https://github.com/folke/trouble.nvim/blob/main/docs/examples.md#filtering.

addz avatar May 30 '24 23:05 addz

oh, btw, I just finally updated to Trouble 3.x version and no need to do the above anymore, Trouble has sweet filtering now..

e.g. Trouble todo toggle filter.buf=0 to restrict matches to current buffer. :wink:

@folke - you can probably close this issue now - Thanks for the great integrations between (your) plugin's! :heart:

addz avatar Jun 01 '24 00:06 addz

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]