Repository navigation
Replies: 1 comment 4 replies
|
I have been trying this as well in a dap setup. For some reason when opening any markdown file Snacks.image is not always setup for me - might be my setup but I don't think so. :lua Snacks.image.setup()In the terminal buffer set the file type to markdown. :lua set ft=markdownTo get the image to render in the terminal buffer :lua vim.api.nvim_exec_autocmds("WinScrolled", { buffer =0 } )Does this work for you ? Rather than set the filetype of the terminal buffer to markdown I would prefer to just set the treesitter parser to markdown using: :lua vim.treesitter.language.register("markdown", "terminal")and it to work out of the box .... but Snacks.image depends on the filetype and tree sitter language - I think they need to be the same and I don't think there is a way at the moment to add your own filetype with supported language. |
Uh oh!
There was an error while loading. Please reload this page.
Hi
I've been finding snacks.image really useful and now I'm wondering if it's possible to show an image inline in a terminal buffer.
The use case would be plotting images using a repl (e.g. yarepl.nvim) and I have in mind that the terminal would run code to create the image, save it to a cache file and then print to the buffer
. snacks.image would then display the image inline in the terminal split.I've seen that if I set the terminal buffer ft to markdown and set modifiable on I can get a floating image but can't get inline to work. I also have to go back and edit the markdown code that's printed to get the image to display. Is it possible to get an inline image and trigger the display from a script?
All reactions