Skip to content

About

A Slideshow inside neovim. Turn your markdown into Slides. A plugin I made for myself, I use it all the time so I intend to update it regularly.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

slides.nvim

A lightweight, distraction-free presentation plugin for Neovim that turns your markdown, org-mode, and asciidoc files into slides rendered directly inside a dedicated new tab or a new buffer.

Inspired by presenting.nvim, but built to present slides cleanly in their own tab/buffer without awkward floating overlays or horizontal pane splits.

slides-nvim

✨ Features

  • Isolated Tab or Buffer View: Slides open in a dedicated tabpage (mode = "tab", default) or replace the buffer in the current window (mode = "buffer"). Quitting cleanly restores your prior window layout and cursor position.
  • Identical Controls: Familiar keyboard controls (n, p, f, l, q, <CR>, <BS>).
  • Unified Command: Single intuitive command :Slides with subcommands and custom separator support.
  • Markup Support: Built-in separators for Markdown, Org-mode, and AsciiDoc, plus support for frontmatter stripping and custom separators (---, etc.).
  • Presentation Timer: Clean floating timer on the top-right corner by typing :timer (or pressing t). Supports count-up elapsed timers, countdown timers (e.g. :timer 15m), pause/resume, and overtime indicators.
  • Auto-Cleanup: Automatically cleans up state if a tab or buffer is closed unexpectedly (:tabclose, :bdelete).
  • Zero External Dependencies: Pure Lua, fully tested with headless Neovim unit tests.

πŸ“¦ Installation

Install with your favorite plugin manager:

Neovim Built-in (vim.pack β€” Docs)

Neovim's native package manager (vim.pack). Add to your init.lua:

vim.pack.add({
  "https://github.com/git-emran/slides.nvim",
})

require("slides").setup({
  options = {
    mode = "tab", -- "tab" (default) or "buffer"
  },
})

You can also specify a git branch, tag, or version constraint:

vim.pack.add({
  {
    src = "https://github.com/git-emran/slides.nvim",
    version = "main", -- or tag / version constraint like vim.version.range('1.0')
  },
})
  • Run :packupdate to fetch and confirm updates.
{
  "git-emran/slides.nvim",
  cmd = { "Slides" },
  opts = {
    options = {
      mode = "tab", -- "tab" (default) or "buffer"
    },
  },
}

Manual Package Installation (:help packages)

Clone into your Neovim pack directory (~/.local/share/nvim/site/pack/...):

# Automatically loaded on startup ("start" package):
git clone https://github.com/git-emran/slides.nvim ~/.local/share/nvim/site/pack/plugins/start/slides.nvim

# Or loaded on-demand ("opt" package):
git clone https://github.com/git-emran/slides.nvim ~/.local/share/nvim/site/pack/plugins/opt/slides.nvim

If placed in opt/, load it in your init.lua with vim.cmd("packadd slides.nvim") and call require("slides").setup().


πŸš€ Usage

Open any Markdown, Org, or AsciiDoc document and run:

:Slides

Navigation Controls (Slide Buffer)

Key Action
n or <CR> Next slide
p or <BS> Previous slide
j or <Down> Scroll down 1 line (when slide has lots of text)
k or <Up> Scroll up 1 line
<C-d> or d Scroll down half-screen
<C-u> or u Scroll up half-screen
<C-f> or <PageDown> Scroll down full screen
<C-b> or <PageUp> Scroll up full screen
gg Scroll to top of slide
G Scroll to bottom of slide
t Toggle presentation timer in top-right corner
f First slide
l Last slide
q Quit presentation mode

Command Usage

:Slides               " Toggle presentation mode
:Slides next          " Jump to next slide
:Slides prev          " Jump to previous slide
:Slides first         " Jump to first slide
:Slides last          " Jump to last slide
:Slides scroll_down   " Scroll down inside current slide (alias: :Slides down)
:Slides scroll_up     " Scroll up inside current slide (alias: :Slides up)
:Slides scroll_top    " Jump to top of current slide (alias: :Slides top)
:Slides scroll_bottom " Jump to bottom of current slide (alias: :Slides bottom)
:Slides quit          " Exit presentation
:Slides ^---          " Present using custom separator

Presentation Timer

Type :timer inside presentation mode (or press t) to show a floating timer in the top-right corner:

:timer                " Toggle timer on/off (starts count-up elapsed time)
:timer 15m            " Start a 15-minute countdown (supports '10', '10m', '90s', '5:00', '1h')
:timer pause          " Pause active timer
:timer resume         " Resume paused timer
:timer reset          " Reset timer to 0 (or original countdown duration)
:timer stop           " Stop and close timer window
:Slides timer [args]  " Alternative invocation under :Slides

Scroll Status Indicator

When slides contain lots of text, the presentation UI retains its padding and structure without overflowing the screen. The text area becomes scrollable, and a status label appears beside the slide counter in the footer:

  • Scroll down: Displayed when there is more slide content below the view.
  • Scroll up: Displayed when scrolling up and slide content remains above the view.
  • End: Displayed when you have reached the end of the slide content.

βš™οΈ Configuration

Pass any overrides to require("slides").setup():

require("slides").setup({
  options = {
    -- Presentation display mode: "tab" (new tabpage) or "buffer" (current window)
    mode = "tab",
    -- Wrap lines in slide window
    wrap = true,
    -- Show slide indicator in the window statusline bar (off by default, footer is used instead)
    show_statusline = false,
    -- Display slide counter indicator at the bottom-left of the slide (e.g. "1/12  Scroll down")
    show_footer = true,
    -- Footer alignment: "left" (default), "right", or "center"
    footer_align = "left",
    -- Vertical alignment: "center" (default) or "top"
    vertical_align = "center",
    -- Horizontal alignment: "left" (default), "center" (block-centered), or "line" (each line centered)
    horizontal_align = "left",
    -- Automatically show top-right timer on presentation start
    show_timer = false,
    -- Custom timer display format (e.g. "⏱ %s" or function(seconds, time_str, is_countdown))
    timer_format = nil,
  },
  separator = {
    markdown = "^#+ ",
    org = "^%*+ ",
    adoc = "^==+ ",
    asciidoctor = "^==+ ",
  },
  -- Retain header/separator lines in slide content
  keep_separator = true,
  -- Strip YAML frontmatter between leading '---' lines
  parse_frontmatter = false,
  -- Ignore slide separators inside code blocks (markdown ``` / ~~~, org-mode, asciidoc)
  skip_code_blocks = true,
  -- Local keymaps for the slide buffer
  keymaps = {
    ["n"] = function() Slides.next() end,
    ["p"] = function() Slides.prev() end,
    ["q"] = function() Slides.quit() end,
    ["f"] = function() Slides.first() end,
    ["l"] = function() Slides.last() end,
    ["<CR>"] = function() Slides.next() end,
    ["<BS>"] = function() Slides.prev() end,
    ["j"] = function() Slides.scroll_down(1) end,
    ["k"] = function() Slides.scroll_up(1) end,
    ["<Down>"] = function() Slides.scroll_down(1) end,
    ["<Up>"] = function() Slides.scroll_up(1) end,
    ["<C-d>"] = function() Slides.scroll_down(5) end,
    ["<C-u>"] = function() Slides.scroll_up(5) end,
    ["<C-f>"] = function() Slides.scroll_page_down() end,
    ["<C-b>"] = function() Slides.scroll_page_up() end,
    ["<PageDown>"] = function() Slides.scroll_page_down() end,
    ["<PageUp>"] = function() Slides.scroll_page_up() end,
    ["d"] = function() Slides.scroll_down(5) end,
    ["u"] = function() Slides.scroll_up(5) end,
    ["gg"] = function() Slides.scroll_to_top() end,
    ["G"] = function() Slides.scroll_to_bottom() end,
    ["t"] = function() Slides.timer() end,
  },
  -- Custom hook to configure slide buffer
  configure_slide_buffer = nil,
})

πŸ§ͺ Running Tests

Run the test suite via headless Neovim:

make test

πŸ“„ License

MIT

About

A Slideshow inside neovim. Turn your markdown into Slides. A plugin I made for myself, I use it all the time so I intend to update it regularly.

Topics

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages