Conversation
Edited yesterday
I've been thinking for a while about creating customized #Markdown highlighting, e.g. making all "TODO" strings stand out in my notes.

Are there any tools/frameworks out there (esp. for #Vim / #Neovim ) that allow me to add new formatting rules on the top of existing highlighters?
5
3
3

@buherator “Those who do not understand Unix^Worg-mode are condemned to reinvent it, poorly.”

1
0
0

@buherator have a look into lazyvim. Its there by default, though i dont know which plugin it is.

0
0
0

@buherator Not sure of vim/neovim but atleast on emacs there's the hl-todo package (https://github.com/tarsius/hl-todo) by @tarsius

1
0
1
@paniash @tarsius Good point, a simple regex-based highlighter would probably cover most of the use cases!
0
0
0
@stf How does org-mode help with customizing highlighters?
1
0
0

@buherator Vim has this capability built in. e.g. if you create a file at .vim/after/ftplugin/markdown.vim containing the line:

```
syntax keyword ErrorMsg TODO
```

Then that will highlight that string with the existing ErrorMsg highlight group in Markdown files. Execute `:hi` to see other groups you can use, or you can create custom ones too.

0
0
1

@buherator the org prefix is a hint what the original purpose was, and since it is about organizing, TODO is automatically highlighted, you can even have small [] checkboxes which you can check/uncheck, and top of the section will give you a nice percentage of how many subtasks are already completed. hiliting TODO in md is a very poor reimplementation of this. org-mode is amazing 4 organizing thoughts & todos. also very nice for latex beamer presentations & blog posts, but that is another story.

1
0
0

@buherator You got some good tips, here's a bad one: it's possible to write extensions for the CommonMark Markdown parser and then replace whatever you're using with your fork/extended version.

If you're lucky you can replace the C engine in whichever tree-sitter plugin you use for highlighting. If you're note so lucky, it doesn't even use CommonMark :)

0
0
1
@stf Several editors highlight "TODO" specifically, but I want a way to format custom sets of markers, possibly depending on the extension/project I'm working on. Another example is marking findings in my notes with different severity labels.
1
0
0

@buherator still sounds like org-mode to me. labels, definitely a well supported thing beyond hiliting. am i replyguying now? kill me...

1
0
0
@stf The main issue that I don't plan to move to Emacs, although I'm sure org-mode can do literally *everything* (khm..Unix philosophy...khm) :D
0
0
0