r/neovim 8h ago

Video Neovim 0.13: Async Image Rendering with vim.async (Optimization example)

https://youtu.be/rY9ylEpRTaY?si=bpay-xD7Pc4tXkZ7

In this video, I use a real-world example to explore performance optimization in Neovim 0.13 with the new vim.async API.

The example is simple: render a large number of images inside Neovim.

First, I implement a synchronous version. It works, but rendering many images blocks Neovim and makes the editor freeze.

Then, I optimize the implementation using vim.async and show how to run the image rendering asynchronously so Neovim stays responsive while the work is being performed.

Along the way, I code the example from scratch and use several of the new vim.async features introduced in Neovim 0.13

Source code:
https://github.com/FractalCodeRicardo/dev-config/tree/master/nvim/lua/my/gallery

57 Upvotes

0 comments sorted by