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

feature: add markdown highlighting for quote NOTE/TODO etc `> [!NOTE]`

Open gallo-s-chingon opened this issue 1 year ago • 2 comments

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.

gallo-s-chingon avatar May 18 '24 11:05 gallo-s-chingon

I agree it could be nice to support mardown files.

destngx avatar May 27 '24 16:05 destngx

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.

Zeioth avatar Jun 28 '24 13:06 Zeioth

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 29 '24 01:07 github-actions[bot]

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.

powerman avatar Jul 29 '24 02:07 powerman

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 Aug 29 '24 01:08 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Sep 05 '24 01:09 github-actions[bot]