Closed tuborgman closed 2 years ago
Strangely, I got the highlighting when I insert the link using NeoSolarized dark :
But if I change the colorsheme
, it disappear, even if I change it back to NeoSolarized :
Opening back Neovim restore the highlights.
Doesn't work for me even in NeoSolarized...
I observe this when changing colorscheme at runtime. If I change the colorscheme in my init.vim
, it works.
The reason is: colorschemes know nothing about telekasten. Hence, they don't define highlights (colors, styles like bold, underline) for telekasten-specific syntax. So when you change colorscheme, all highlights are cleared before the new ones are applied. But since your colorschemes don't know anything about tklink
etc, they will not set highlights for them. When you switch back to your original colorscheme, the highligts for the telekasten syntax still remain cleared, hence you don't get them back.
Since we cannot expect all colorschemes to support our plugin, we need a workaround.
You could:
hi tklink ...
and related commands in a separate file and reload it (:source myhighlights.vim
) on
demand. You could define a mapping for that to have it handy.init.vim
instead of on-the-flyMind you, if you change color scheme, you probably also want to change the colors of the telekasten-specific syntax.
One way to get colorscheme-matching highlights for links would be to hi link tklink markdownLinkText
and hi link tkBrackets markdownLinkDelimiter
. For tkHighlight
there is no markdown equivalent, so you have to set it to some
value that makes sense for the desired colorscheme.
Doesn't work for me even in NeoSolarized...
You are not specific. Have you put the highlight commands in your init.vim
? Check the README.
Hi!
Absolutely amazing plugin. What I am missing in my neovim setup is the underlined links for [[LinkToNote]]. Though, in the readme it said that it should be underlined.
using NeoVIM v0.7.0-dev and gruvbox theme (morhetz/gruvbox).
Thanks