Compare commits

..

2 Commits

Author SHA1 Message Date
372865f9c4 vim:syn:md: Use lookarounds instead of \zs & \ze
Apparently the `\zs` token does not match characters if they are already
part of a syntax match. For example in `[^0][^1]` only the zero footnote
is matched. Fix this by using a positive lookbehind that does not have
this limitation.

Additionally, use a negative lookahead for the colon to make the pattern
slightly more readable, since it does not need the end-of-line check.
2025-08-12 13:00:41 +02:00
3fb5b5f376 vim:syn:md: Conceal numeric footnotes
Conceal numeric footnotes with superscript numbers. The whole thing is a
bit of a gimmick since only single digit numbers are concealed but I had
this idea for quite some time and wanted to execute it.

When not put into the `after/` directory, the matches are overwritten by
the `markdownFootnote` group.
2025-08-12 12:59:33 +02:00

View File

@@ -0,0 +1,11 @@
" Either not at the start of the line, or otherwise not followed by a colon
syntax match markdownFootnoteZero /\v(.@1<=\[\^0\])|(^\[\^0\]:@!)/ conceal cchar=
syntax match markdownFootnoteOne /\v(.@1<=\[\^1\])|(^\[\^1\]:@!)/ conceal cchar=¹
syntax match markdownFootnoteTwo /\v(.@1<=\[\^2\])|(^\[\^2\]:@!)/ conceal cchar=²
syntax match markdownFootnoteThree /\v(.@1<=\[\^3\])|(^\[\^3\]:@!)/ conceal cchar=³
syntax match markdownFootnoteFour /\v(.@1<=\[\^4\])|(^\[\^4\]:@!)/ conceal cchar=
syntax match markdownFootnoteFive /\v(.@1<=\[\^5\])|(^\[\^5\]:@!)/ conceal cchar=
syntax match markdownFootnoteSix /\v(.@1<=\[\^6\])|(^\[\^6\]:@!)/ conceal cchar=
syntax match markdownFootnoteSeven /\v(.@1<=\[\^7\])|(^\[\^7\]:@!)/ conceal cchar=
syntax match markdownFootnoteEight /\v(.@1<=\[\^8\])|(^\[\^8\]:@!)/ conceal cchar=
syntax match markdownFootnoteNine /\v(.@1<=\[\^9\])|(^\[\^9\]:@!)/ conceal cchar=