todo-comments.nvim
todo-comments.nvim copied to clipboard
feature: add markdown highlighting for quote NOTE/TODO etc `> [!NOTE]`
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.
it's only a problem in the sense that some markdown previewers hide comments, I've written this twice but only the codeblock version will be visible
<!-- NOTE: this note will be invisible on GitHub, and only visible whilst viewing in neovim -->
I have the same line as written in the code block below this horizontal line
but you can't see it
Describe the solution you'd like
I stumbled upon this with a snippet
[!NOTE] this "comment" is visible in a previewer and here as well
[!TODO] doesn't seem to work but still visible in a previewer / here without having to wrap in a code block
Describe alternatives you've considered
I was considering switching to neorg but I already spent a few dozen hours just getting my current config to work with markdown and do not want to break all the markdown files I've written over the years (I'm a prose writer not a coder, chatGPT write my init)
Additional context
I suppose it would defeat the purpose, or not be inline with "todo-comments" as I'm requesting "todo-quotes" but this is the best looking, IMO, TODO/NOTES/etc nvim plugin out there.
I agree it could be nice to support mardown files.
This can be achieved already like
opts = {
highlight = {
comments_only = false
},
keywords = {
NOTE = { icon = " ", color = "info" },
},
}
But it's true comments_only should set automatically to false when editing a markdown file.
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 one works for me:
vim.api.nvim_create_autocmd('BufEnter', {
desc = 'Enable todo-comments for text',
group = vim.api.nvim_create_augroup('user.todo.text', { clear = true }),
callback = function(ev)
local config = require 'todo-comments.config'
local comments_only = string.match(ev.file, '%.md$') == nil
and string.match(ev.file, '%.txt$') == nil
and string.match(ev.file, '%.adoc$') == nil
and string.match(ev.file, '%.asciidoc$') == nil
config.options.highlight.comments_only = comments_only
end,
})
When using lazy-loading on event make sure you load plugin on 'VimEnter' and not on 'VaryLazy', otherwise this autocmd won't run on vim start.
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.