Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
631 stars 26 forks source link

[Question] How to pretty render documentation preview #73

Open youwen5 opened 1 day ago

youwen5 commented 1 day ago

In nvim-cmp, the preview popup is rendered (afaik) as markdown which cleans it up and adds treesitter highlighting for code snippets. image Is there a way I can have the preview buffer rendered? image

dsully commented 1 day ago

Are you using noice.nvim? As it also cleans up the markdown. It might be a good idea to use that code in blink.

youwen5 commented 1 day ago

Not using noice, I'm in the middle of redoing my config from scratch so this should be a fairly minimal setup. I have the render-markdown.nvim plugin installed which might be doing it, will check in a bit

DaniBedz commented 23 hours ago

Please let me know if you manage to get this working - having the same issue here with markdown being displayed.

sudo-tee commented 20 hours ago

I was able to get it to work with the render-markdown plugin with the following config

{
      'MeanderingProgrammer/render-markdown.nvim',
      ---@module 'render-markdown'
      ---@type render.md.UserConfig
      opts = {
        file_types = { 'markdown', 'Avante' },
        log_level = 'debug',
        overrides = {
          buftype = {
            nofile = {
              render_modes = { 'n', 'c', 'i' },
              debounce = 5,
            },
          },
          filetype = {},
        },
      },
      ft = { 'markdown', 'Avante' },
    }
Biggybi commented 18 hours ago

@sudo-tee nice one!

Also, one might want to undo paddings to avoid wrapping lines:

overrides = {
  buftype = {
    nofile = {
      render_modes = { "n", "c", "i" },
      debounce = 5,
      code = {
        left_pad = 0,
        right_pad = 0,
        language_pad = 0,
      },
    },
  },
  filetype = {},
},