obsidian.nvim
obsidian.nvim copied to clipboard
How to set header background color
Hey thanks for this great plugin 🙏🏾 is there a possibility to set background color for header like # ## ### ... ? Coudnt find the hl_groups.
Would like to have something like here: https://github.com/folke/todo-comments.nvim
thanks :)
I would like to know too! #392
Figured it out after like a week...
You can use :Inspect to return the highlight of a specific element under your cursor. This way you can add custom highlights using vim.cmd[[highlight...]]
Would have been nice if someone pointed that out to me. But hope it helps.
Thanks for now :))
Just getting this from Inspect
:
Treesitter
- @markup.heading.2.marker.markdown links to Title markdown
any idea, how to set colors for this?
yeah as i said you add a vim command to your lua config
vim.cmd[[highlight elementName guifg="#FFFFFF" guibg="#FF0000" gui=underline]]
you can specify fg color, bg color, and display type like bold italic, etc
your cursor is over the marker for ##
not the h2 element itself
for changing the marker, its
vim.cmd[[highlight @markup.heading.2.marker.markdown guifg="" ]]
Great, it works. But now Im able to colorize marker and heading, not space between 😆 any idea how to get the whole line?
no highlight for the space in between, as far as im aware, shouldnt matter too much...
use google and these commands if confused about highlights. :highlights :Inspect :InspectTree
this type of stuff should be documented somewhere in the plugin, if the creator sees it, them im happy to make an entry into docs.
this is what it looks like for me
You can use headlines.nvim to tweak the way your headlines look quite a bit. This goes much further than just adjusting the background color.
Here I assigned custom colors to different headline levels:
Thats pretty cool! Thanks. Im gonna check that out.
thanks, but dont like it. Looks to chaotic to me ... just wanna highlight marker of headings like
vim.cmd([[highlight @markup.heading.1.marker.markdown guibg=#FF5733 guifg=#FF5733]])
vim.cmd([[highlight @markup.heading.2.marker.markdown guibg=#C70039 guifg=#C70039]])
vim.cmd([[highlight @markup.heading.3.marker.markdown guibg=#900C3F guifg=#900C3F]])
vim.cmd([[highlight @markup.heading.4.marker.markdown guibg=#FFC300 guifg=#FFC300]])
and it worked like charm some weeks before ... now there is no @markup.heading.4.marker
anymore :'(((