From d030b52e2dd18a076e08a426172ed1784d44d5fc Mon Sep 17 00:00:00 2001 From: ekliot Date: Sun, 23 Jul 2023 23:16:04 +0000 Subject: [PATCH 1/5] make aliased wikilink highlighting consistent --- syntax/telekasten.vim | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/syntax/telekasten.vim b/syntax/telekasten.vim index 600e486..f77edd4 100644 --- a/syntax/telekasten.vim +++ b/syntax/telekasten.vim @@ -8,7 +8,9 @@ unlet b:current_syntax syn region Comment matchgroup=Comment start="" contains=tkTag keepend -syntax region tkLink matchgroup=tkBrackets start=/\[\[/ end=/\]\]/ display oneline +syntax region tkLink matchgroup=tkBrackets start=/\[\[/ end=/\]\]/ keepend display oneline contains=tkAliasedLink +syntax match tkAliasedLink "[^\[\]]\+|" contained conceal + syntax region tkHighlight matchgroup=tkBrackets start=/==/ end=/==/ display oneline contains=tkHighlightedAliasedLink syntax match tkTag "\v#[a-zA-ZÀ-ÿ]+[a-zA-ZÀ-ÿ0-9/\-_]*" @@ -17,10 +19,6 @@ syntax match tkTag "\v:[a-zA-ZÀ-ÿ]+[a-zA-ZÀ-ÿ0-9/\-_]*:" syntax match tkTagSep "\v\s*,\s*" contained syntax region tkTag matchgroup=tkBrackets start=/^tags\s*:\s*\[\s*/ end=/\s*\]\s*$/ contains=tkTagSep display oneline -syntax region tkAliasedLink start="\[\[[^\]]\+|" end="\]\]" keepend oneline contains=tkLinkAlias,tkLinkBody -syntax region tkHighlightedAliasedLink start="\[\[[^\]]\+|" end="\]\]" keepend oneline contained contains=tkLinkAlias,tkLinkBody -syntax region tkLinkAlias start="|"ms=s+1 end=".+\]\]"me=e-2 keepend contained -syntax region tkLinkBody start="\[\["ms=s+2 end="|" keepend contained conceal let b:current_syntax = 'telekasten' @@ -38,4 +36,4 @@ let b:current_syntax = 'telekasten' " " " Tags " hi tkTagSep ctermfg=gray -" hi tkTag ctermfg=magenta +" hi tkTag ctermfg=magenta \ No newline at end of file From e7ea7af18e68d9261356f18b025ce1e3288e2953 Mon Sep 17 00:00:00 2001 From: ekliot Date: Sun, 23 Jul 2023 23:24:19 +0000 Subject: [PATCH 2/5] update documentation --- README.md | 1 + doc/telekasten.txt | 5 +---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d97b601..53bc261 100644 --- a/README.md +++ b/README.md @@ -270,6 +270,7 @@ Telekasten.nvim allows you to color your `[[links]]` and `#tags` by providing the following syntax groups: - `tkLink` : the link title inside the brackets +- `tkAliasedLink` : the concealed portion of `[[concealed link|link alias]]` - `tkBrackets` : the brackets surrounding the link title - `tkHighlight` : ==highlighted== text (non-standard markdown) - `tkTag` : well, tags diff --git a/doc/telekasten.txt b/doc/telekasten.txt index 69890c1..813ba46 100644 --- a/doc/telekasten.txt +++ b/doc/telekasten.txt @@ -496,10 +496,7 @@ groups: - `tkBrackets` : the brackets surrounding the link title - `tkHighlight` : ==highlighted== text (non-standard markdown) - `tkTag` : well, tags -- `tkAliasedLink` : link with alias -- `tkHighlightedAliasedLink` : link with alias in `tkAliasedLink` -- `tkLinkAlias` : body of the link (left part of `[[aaa|bbb]]`) -- `tkLinkBody` : alias of the link (right part of `[[aaa|bbb]]`) +- `tkAliasedLink` : the concealed part of the link (left part of `[[aaa|bbb]]`) `tkHighlight`, has nothing to do with links but I added it anyway, since I like highlighting text when taking notes. From 3b901728a2eeccabc607989df985ea2b9629a6b8 Mon Sep 17 00:00:00 2001 From: ekliot Date: Sun, 23 Jul 2023 23:55:02 +0000 Subject: [PATCH 3/5] fix highlighted aliased links concealment --- syntax/telekasten.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/telekasten.vim b/syntax/telekasten.vim index f77edd4..fecf03c 100644 --- a/syntax/telekasten.vim +++ b/syntax/telekasten.vim @@ -11,7 +11,7 @@ syn region Comment matchgroup=Comment start="" contains=tkTag kee syntax region tkLink matchgroup=tkBrackets start=/\[\[/ end=/\]\]/ keepend display oneline contains=tkAliasedLink syntax match tkAliasedLink "[^\[\]]\+|" contained conceal -syntax region tkHighlight matchgroup=tkBrackets start=/==/ end=/==/ display oneline contains=tkHighlightedAliasedLink +syntax region tkHighlight matchgroup=tkBrackets start=/==/ end=/==/ display oneline contains=tkAliasedLink syntax match tkTag "\v#[a-zA-ZÀ-ÿ]+[a-zA-ZÀ-ÿ0-9/\-_]*" syntax match tkTag "\v:[a-zA-ZÀ-ÿ]+[a-zA-ZÀ-ÿ0-9/\-_]*:" From 935db316632a958ed16948019403db31eca2898d Mon Sep 17 00:00:00 2001 From: Elijah Kliot Date: Thu, 7 Sep 2023 23:03:09 -0600 Subject: [PATCH 4/5] deprecation note --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 53bc261..e010ae0 100644 --- a/README.md +++ b/README.md @@ -285,6 +285,12 @@ hi tkLink ctermfg=Blue cterm=bold,underline guifg=blue gui=bold,underline hi tkBrackets ctermfg=gray guifg=gray ``` +**NOTE**: Users configuring the following highlight groups prior to 09/2023, be aware they are deprecated: +- `tkHighlightedAliasLink`: this syntax group is now covered by `tkHighlight` +- `tkLinkBody`: this syntax group is renamed to `tkAliasedLink` +- `tkAliasedLink`: this group used to cover the whole link, it is now equivalent to the former `tkLinkBody` +- `tkLinkAlias`: this rule is deprecated + ### Mappings The real power of Telekasten lays in defining sensible mappings to make your From bf011af80b476e3112f2e9934dc93cfe1f353679 Mon Sep 17 00:00:00 2001 From: Elijah Kliot Date: Thu, 7 Sep 2023 23:06:46 -0600 Subject: [PATCH 5/5] move to doc --- README.md | 6 ------ doc/telekasten.txt | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index e010ae0..53bc261 100644 --- a/README.md +++ b/README.md @@ -285,12 +285,6 @@ hi tkLink ctermfg=Blue cterm=bold,underline guifg=blue gui=bold,underline hi tkBrackets ctermfg=gray guifg=gray ``` -**NOTE**: Users configuring the following highlight groups prior to 09/2023, be aware they are deprecated: -- `tkHighlightedAliasLink`: this syntax group is now covered by `tkHighlight` -- `tkLinkBody`: this syntax group is renamed to `tkAliasedLink` -- `tkAliasedLink`: this group used to cover the whole link, it is now equivalent to the former `tkLinkBody` -- `tkLinkAlias`: this rule is deprecated - ### Mappings The real power of Telekasten lays in defining sensible mappings to make your diff --git a/doc/telekasten.txt b/doc/telekasten.txt index 813ba46..0f96b1e 100644 --- a/doc/telekasten.txt +++ b/doc/telekasten.txt @@ -527,6 +527,12 @@ You can assign colors to the new syntax groups in your `init.vim`: hi tkTag ctermfg=175 guifg=#d3869B < +NOTE: Users configuring the following highlight groups prior to 09/2023, be aware they are deprecated: +- `tkHighlightedAliasLink`: this syntax group is now covered by `tkHighlight` +- `tkLinkBody`: this syntax group is renamed to `tkAliasedLink` +- `tkAliasedLink`: this group used to cover the whole link, it is now equivalent to the former `tkLinkBody` +- `tkLinkAlias`: this rule is deprecated + ================================================================================ Section 3: Usage *telekasten.usage*