nvim-telekasten / telekasten.nvim

A Neovim (lua) plugin for working with a markdown zettelkasten / wiki and mixing it with a journal, based on telescope.nvim
MIT License
1.38k stars 89 forks source link

Links inside square brackets are not underlined #54

Closed tuborgman closed 2 years ago

tuborgman commented 2 years ago

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

Rom1deTroyes commented 2 years ago

Strangely, I got the highlighting when I insert the link using NeoSolarized dark : image

But if I change the colorsheme, it disappear, even if I change it back to NeoSolarized : image image

Opening back Neovim restore the highlights.

tuborgman commented 2 years ago

Doesn't work for me even in NeoSolarized...

renerocksai commented 2 years ago

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:

Mind 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.

renerocksai commented 2 years ago

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.