tree-sitter-grammars / tree-sitter-markdown

Markdown grammar for tree-sitter
MIT License
414 stars 52 forks source link

Is there any way that I can get the conceal math in Markdown? #30

Closed AndOrangutan closed 2 years ago

AndOrangutan commented 2 years ago

Grettings, I have been working on getting my notetaking setup for my classes and love having some sort of plugin to do math conceal. As you can see even though I have preservim/vim-markdown installed but the conceal doesn't work with Treesitter.

With TS enabled: 2022-01-24_11-49

With TS Disabled: 2022-01-24_11-49_1

MDeiml commented 2 years ago

You could try adding this to your config (from nvim-treesitters help):

  lua <<EOF
  require'nvim-treesitter.configs'.setup {
    highlight = {
      -- Setting this to true will run `:h syntax` and tree-sitter at the same time.
      -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
      -- Using this option may slow down your editor, and you may see some duplicate highlights.
      -- Instead of true it can also be a list of languages
      additional_vim_regex_highlighting = false,
    },
  }
  EOF
AndOrangutan commented 2 years ago

Thank you so much. :D

megalithic commented 2 years ago
      additional_vim_regex_highlighting = false,

curious @MDeiml ; can this boolean be set on a per-lang basis? or is it all-or-nothing?

MDeiml commented 2 years ago

It says in the nvim-treesitter docs that it can be a list of languages, so { 'markdown' } in this case