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

Ignore the node_modules and .git directory

Open Ali-Aref opened this issue 4 years ago • 5 comments

When I'm trying to list my project todos :TodoLocList, it lists the node_modules todos as well. And I couldn't stop it doing this.

Ali-Aref avatar Jan 13 '22 14:01 Ali-Aref

Me too. Really wish I could remove node_modules from seeing.

diego-rapoport avatar Feb 19 '22 17:02 diego-rapoport

I had this issue as well and I found that this solution works https://github.com/folke/todo-comments.nvim/issues/71

boring10 avatar Mar 09 '22 19:03 boring10

I had this issue as well and I found that this solution works #71

Hi!! How did you make it work? I tried but it didn't work.

diego-rapoport avatar Mar 11 '22 19:03 diego-rapoport

I got the majority of this config elsewhere but I added the glob line for the search and it worked for me. Looks like it matches the basic recommended config though.

todo_comments.setup({
	signs = true,
	sign_priority = 8,
	keywords = {
		FIX = {
			icon = " ",
			color = "error",
			alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
		},
		TODO = { icon = " ", color = "info" },
		HACK = { icon = " ", color = "warning" },
		WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
		PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
		NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
	},
	merge_keywords = true,
	highlight = {
		before = "",
		keyword = "wide",
		after = "fg",
		pattern = [[.*<(KEYWORDS)\s*:]],
		comments_only = true,
		max_line_len = 400,
		exclude = {},
	},
	colors = {
		error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
		warning = { "DiagnosticWarning", "WarningMsg", "#FBBF24" },
		info = { "DiagnosticInfo", "#2563EB" },
		hint = { "DiagnosticHint", "#10B981" },
		default = { "Identifier", "#7C3AED" },
	},
	search = {
		command = "rg",
		args = {
			"--color=never",
			"--no-heading",
			"--with-filename",
			"--line-number",
			"--column",
			"--glob=!node_modules",
		},
		pattern = [[\b(KEYWORDS):]],
	},
})

boring10 avatar Mar 11 '22 23:03 boring10

I got the majority of this config elsewhere but I added the glob line for the search and it worked for me. Looks like it matches the basic recommended config though.

todo_comments.setup({
	signs = true,
	sign_priority = 8,
	keywords = {
		FIX = {
			icon = " ",
			color = "error",
			alt = { "FIXME", "BUG", "FIXIT", "ISSUE" },
		},
		TODO = { icon = " ", color = "info" },
		HACK = { icon = " ", color = "warning" },
		WARN = { icon = " ", color = "warning", alt = { "WARNING", "XXX" } },
		PERF = { icon = " ", alt = { "OPTIM", "PERFORMANCE", "OPTIMIZE" } },
		NOTE = { icon = " ", color = "hint", alt = { "INFO" } },
	},
	merge_keywords = true,
	highlight = {
		before = "",
		keyword = "wide",
		after = "fg",
		pattern = [[.*<(KEYWORDS)\s*:]],
		comments_only = true,
		max_line_len = 400,
		exclude = {},
	},
	colors = {
		error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
		warning = { "DiagnosticWarning", "WarningMsg", "#FBBF24" },
		info = { "DiagnosticInfo", "#2563EB" },
		hint = { "DiagnosticHint", "#10B981" },
		default = { "Identifier", "#7C3AED" },
	},
	search = {
		command = "rg",
		args = {
			"--color=never",
			"--no-heading",
			"--with-filename",
			"--line-number",
			"--column",
			"--glob=!node_modules",
		},
		pattern = [[\b(KEYWORDS):]],
	},
})

Oh man, thank you very much. I haven't payed attention to the glob args and left it as public, just like the other person in the #71 left it. Now it makes sense haha. Thanks for sharing.

diego-rapoport avatar Mar 12 '22 13:03 diego-rapoport