Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Highlight for bold and italic text #748

Open
HayKor opened this issue Oct 10, 2024 · 2 comments
Open

Highlight for bold and italic text #748

HayKor opened this issue Oct 10, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@HayKor
Copy link

HayKor commented Oct 10, 2024

📚 The doc issue

The docs in README.md say about hl_groups. I thought that with them I can highlight bold and italic text. I thought that if they are concealed, they definitely have a way to be highlighted. But scrolling through docs and src code didn't give me any answer on how do I highlight bold and italic text (which are concealed).

                hl_groups = {
                    -- The options are passed directly to `vim.api.nvim_set_hl()`. See `:help nvim_set_hl`.
                    ObsidianTodo = { bold = true, fg = "#f78c6c" },
                    ObsidianDone = { bold = true, fg = "#89ddff" },
                    ObsidianRightArrow = { bold = true, fg = "#f78c6c" },
                    ObsidianTilde = { bold = true, fg = "#ff5370" },
                    ObsidianImportant = { bold = true, fg = "#d73128" },
                    ObsidianBullet = { bold = true, fg = "#89ddff" },
                    ObsidianRefText = { underline = true, fg = "#c792ea" },
                    ObsidianExtLinkIcon = { fg = "#c792ea" },
                    ObsidianTag = { italic = true, fg = "#89ddff" },
                    ObsidianBlockID = { italic = true, fg = "#89ddff" },
                    ObsidianHighlightText = { bg = "#75662e" },

                    -- TRIED BRUTEFORCE THE ANSWER
                    ObsidianBold = { bold = true, fg = "#c792ea" }, -- Why no such hl_group?
                    ObsidianItalic = { bold = true, fg = "#c792ea" }, -- 
                },

Suggest a potential alternative/fix

No response

@HayKor HayKor added the documentation Improvements or additions to documentation label Oct 10, 2024
@sebszyller
Copy link

this should work with regular markdown highlighting instead of via Obsidian. In treesitter, you have @markup.italic.markdown_inline and @markup.strong.markdown_inline. You can put your cursor on a piece of text and run :Inspect to see what HL groups are applied.

@HayKor
Copy link
Author

HayKor commented Oct 14, 2024

Thanks a lot for your answer, that's just what I wanted!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants