No description
Find a file
Barrett Ruth c5c69e9ec2
Some checks are pending
quality / changes (push) Waiting to run
quality / Lua Format Check (push) Blocked by required conditions
quality / Lua Lint Check (push) Blocked by required conditions
quality / Lua Type Check (push) Blocked by required conditions
quality / Markdown Format Check (push) Blocked by required conditions
fix: prevent infinite loop when started from non-filesystem buffer (#35)
## Problem

Calling \`:LiveServerStart\` from an oil.nvim buffer (or any URI-scheme
buffer) caused two issues: first, \`find_cached_dir\` entered an
infinite loop as \`fnamemodify(cur, ':h')\` degenerated to \`.\`,
freezing Neovim and pegging the CPU; second, even after fixing the loop,
the server would error out instead of doing the right thing — serving
the directory being browsed.

## Solution

Add a progress check to \`find_cached_dir\` so it bails if the path
stops changing. Fix \`resolve_dir\` to detect URI-scheme buffer names
(e.g. \`oil:///path/to/dir\`) and extract the real filesystem path from
them, so \`:LiveServerStart\` correctly serves the browsed directory.
Also corrects the bug report repro template (\`require('lazy')\`, \`lazy
= false\`, no deprecated \`opts\`) and ignores \`repro.lua\`.

Closes #34
2026-03-06 11:58:46 -05:00
.github fix: prevent infinite loop when started from non-filesystem buffer (#35) 2026-03-06 11:58:46 -05:00
doc feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00
lua/live-server fix: prevent infinite loop when started from non-filesystem buffer (#35) 2026-03-06 11:58:46 -05:00
plugin feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00
scripts ci: nix 2026-03-04 14:11:41 -05:00
.editorconfig chore: update project configs to match cp.nvim 2026-02-03 21:00:07 -05:00
.gitignore fix: prevent infinite loop when started from non-filesystem buffer (#35) 2026-03-06 11:58:46 -05:00
.luarc.json ci : scripts + format 2026-03-04 13:42:15 -05:00
.pre-commit-config.yaml feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00
.styluaignore ci : scripts + format 2026-03-04 13:42:15 -05:00
flake.lock feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00
flake.nix ci: nix 2026-03-04 14:11:41 -05:00
LICENSE fix(ci): add license 2026-02-03 21:28:34 -05:00
live-server.nvim-scm-1.rockspec chore: add CI, pre-commit, and luarocks configs 2026-02-03 21:01:57 -05:00
README.md feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00
selene.toml feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00
stylua.toml chore: update project configs to match cp.nvim 2026-02-03 21:00:07 -05:00
vim.yaml feat: replace npm live-server with pure-Lua HTTP server (#29) 2026-03-02 23:16:35 -05:00

live-server.nvim

Live reload HTML, CSS, and JavaScript files inside Neovim. No external dependencies — the server runs entirely in Lua using Neovim's built-in libuv bindings.

Dependencies

  • Neovim >= 0.10

Installation

Install with your package manager or via luarocks:

luarocks install live-server.nvim

Documentation

:help live-server.nvim

Known Limitations

  • No recursive file watching on Linux: libuv's uv_fs_event only supports recursive directory watching on macOS and Windows. On Linux (inotify), the recursive flag is silently ignored, so only files in the served root directory trigger hot-reload. Files in subdirectories (e.g. css/style.css) will not be detected. See libuv#1778.