Neovim plugin for birta — a fast markdown previewer with GitHub-style rendering
- Per-buffer preview — each buffer gets its own server instance
- Scroll sync — cursor movement in Neovim scrolls the browser preview
- Theme support — custom and bundled; GitHub, Dracula, Nord, Catppuccin, Tokyo Night, and more, with live hot-swap in the browser
- Reading mode — distraction-free centered layout for prose
- Raw source view — toggle between rendered preview and syntax-highlighted source
- Auto-cleanup — preview stops when the buffer is deleted or Neovim exits
- Neovim >= 0.9
- birta CLI in your
PATH
{
"hugvit/birta.nvim",
cmd = { "Birta" },
opts = {}, -- see Configuration options
}use {
"hugvit/birta.nvim",
config = function()
require("birta").setup() -- see Configuration options
end,
}| Command | Description |
|---|---|
:Birta start |
Start preview for the current buffer |
:Birta stop |
Stop preview for the current buffer |
:Birta toggle |
Toggle preview on/off |
The previous commands :BirtaPreview, :BirtaStop, and :BirtaToggle have been deprecated in favor of the subcommand pattern above.
require("birta").setup({
cmd = "birta", -- path to birta binary
theme = nil, -- theme name or path to .toml file
syntax_theme = nil, -- path to .tmTheme file
css = nil, -- path to custom CSS file
port = nil, -- fixed port (nil = auto-assign)
no_open = false, -- don't open browser automatically
no_theme_swap = false, -- disable theme switching dropdown
no_toggle = false, -- disable light/dark toggle
no_header = false, -- hide the header bar
light = false, -- start in light mode
dark = false, -- start in dark mode
reading_mode = false, -- start in reading mode
raw_mode = false, -- start in raw mode (source view)
font_body = nil, -- body font family
font_mono = nil, -- monospace font family
static_mode = false, -- export a self-contained HTML bundle, open it, and exit (no live server)
out = nil, -- output dir for static_mode (nil = temp birta-<name> folder)
bind = nil, -- keybinding overrides (table, see below)
})All options map directly to birta CLI flags.
The bind option lets you override birta's browser keybindings. Pass a table mapping action names to key strings:
require("birta").setup({
bind = {
toggle_reading = "Alt+r",
toggle_dark = "Alt+d",
toggle_raw = "Alt+u",
focus_theme = "Alt+t",
exit_reading = "Escape",
},
})The default keybindings in birta are single letters (r, d, t) which may conflict with browser extensions like Vimium. Use Alt+ prefixed keys to avoid collisions. Set a key to "none" to disable a binding.
