Live document rendering in real-time with flexible renderer support.
Project details
Beside.nvim provides an innovative solution for editing documents by rendering a live preview in a split view. As edits are made, the preview updates instantaneously using any installed renderer like leaf, glow, or pandoc. This flexible setup allows users to switch renderers effortlessly, ensuring optimal output for various document types.
beside.nvim provides a seamless, live rendering experience of documents being edited in Neovim, allowing users to view the changes in real-time beside their source code. The tool supports multiple terminal renderers—such as leaf, glow, pandoc, or carve—adapting to user preferences and rendering them in a split view. This unique feature combines the flexibility of selecting the preferred renderer for specific file types while keeping an eye on the editing process.
Live Preview: The document preview updates in real-time as edits are made in the source. Scrolling in one pane automatically scrolls the other, enhancing the editing experience.
:Beside
Toggles the live preview for the active buffer.
Versatile Renderer Support: Switch between different renderers using commands like :Beside glow to utilize different styling outputs or rendering capabilities according to the needs of the document being worked on. As a result, users can conveniently take advantage of the outputs from leaf, glow, and pandoc by simply changing the command.
Customizable Configuration: Users have the ability to customize the preview width, rendering delay, and preferred renderers based on file types. Here is an example configuration:
require('beside').setup({
width = 0.4,
delay = 100,
prefer = {
markdown = { 'leaf', 'glow', 'pandoc' },
},
})
Adding New Renderers: The repository supports a growing list of renderers, and users are encouraged to extend its capabilities by adding new renderers. Here’s a basic template for creating a new renderer:
require('beside').setup({
renderers = {
mdcat = {
filetypes = { markdown = true },
command = function(context)
return { 'mdcat', '--columns', tostring(context.width), '-' }
end,
},
},
})
Easy Integration: Integration is straightforward with Neovim version 0.10 or newer required, and the tool can be installed using lazy.nvim easily.
The capabilities of beside.nvim streamline the editing process, allowing for a more efficient workflow while accommodating the preferences of various users. Contributions in the form of bug reports or new renderers are welcomed, promoting a collaborative development environment.
Comments
0Start the conversation
Share the first comment.