Replies: 3 comments 1 reply
-
|
I have the same question. I'm using the todo symbols as kind of bookmark to navigate my code. So, I'd prefer to see the todo list for the file currently been edited only. |
Beta Was this translation helpful? Give feedback.
-
|
May I ask if this is related to the If it is, may I ask how to config it so that ":TodoTrouble" or ":TodoTelescope" only shows the todos in the current buffer? |
Beta Was this translation helpful? Give feedback.
-
|
OK, finally... here's my config of return {
"folke/todo-comments.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"ibhagwan/fzf-lua",
},
version = "*", -- ensure using the latest version
optional = true,
opts = {
merge_keywords = true,
keywords = {
oo = { icon = "", color = "#505050" }, -- use "# oo:" to activate the keyword
},
},
-- === show custom todo "oo" in current buffer only ===
-- -- option 1: if using telescope instead of fzf
-- config = function(_, opts)
-- require("todo-comments").setup(opts)
-- vim.keymap.set("n", "<leader>st", function()
-- require("telescope.builtin").grep_string({
-- search = "oo|TODO|HACK|WARN|PERF|NOTE|FIX",
-- file_ignore_patterns = {},
-- only_sort_text = true,
-- path_display = { "smart" },
-- search_dirs = { vim.fn.expand("%:p") },
-- })
-- end, { desc = "Todo (current file)" })
-- end,
-- option 2: If using fzf-lua instead of telescope
-- stylua: ignore
config = function(_, opts)
require("todo-comments").setup(opts)
vim.keymap.set(
"n",
"<leader>zo",
function()
local dir = vim.fn.expand("%:p:h")
require("todo-comments.fzf").todo(
{
cwd = dir,
query = vim.fn.expand("%:t"),
}
)
end,
{ desc = "Todo (current file)" }
)
end,
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all
I have installed todo-comments, and I could only get a list of all the TODOs in my project. Since the project is huge, I'd rather see only the comments in the buffer I am currently editing. Is there a way to do that?
Thanks for the help
A.
Beta Was this translation helpful? Give feedback.
All reactions