todo-comments.nvim
todo-comments.nvim copied to clipboard
Show for current buffer
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!
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
?
I think you can achieve that with the solution from issue https://github.com/folke/todo-comments.nvim/issues/110.
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"})
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.
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:
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.
This issue was closed because it has been stalled for 7 days with no activity.