Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
636bac2
feat: replace npm live-server with pure-Lua HTTP server
barrettruth Feb 23, 2026
d4fcc8c
ci: format
barrettruth Feb 23, 2026
5f37a4a
feat: modernization, too
barrettruth Feb 23, 2026
ce3cf5b
fix: ignore env files
barrettruth Feb 23, 2026
ff2070c
doc: include readme version
barrettruth Feb 23, 2026
fc52c8c
doc: deprecation msgs
barrettruth Feb 23, 2026
e61e453
feat: add css_inject config and comprehensive args migration
barrettruth Feb 23, 2026
06a16de
fix: add hard version gate for Neovim < 0.10
barrettruth Feb 23, 2026
c0fee85
ci: format
barrettruth Feb 23, 2026
fd1e874
feat: add debug config option to instrument hot-reload chain
barrettruth Feb 23, 2026
b35faaf
doc: css live reload recursive css notification
barrettruth Feb 23, 2026
9419943
feat: warn about css hot reload missing on linux, if set
barrettruth Feb 23, 2026
94f1dac
ci: format
barrettruth Feb 23, 2026
226ce3e
fix(ci): migrate selene std to yaml for luajit parser support
barrettruth Feb 23, 2026
ea68a72
fix(ci): resolve lua-typecheck undefined types and globals
barrettruth Feb 23, 2026
4db8110
build(flake): add lua-language-server to devShell
barrettruth Feb 23, 2026
440ec1b
ci: use nix commands for ic
barrettruth Feb 23, 2026
8dfd172
fix: remove redundant ci file
barrettruth Feb 23, 2026
19d63ad
feat: add healthcheck module
barrettruth Mar 3, 2026
0b01aac
ci: format
barrettruth Mar 3, 2026
ac31144
fix: move linux recursive watch warning to healthcheck
barrettruth Mar 3, 2026
ce19510
ci: format
barrettruth Mar 3, 2026
017956e
ci: format
barrettruth Mar 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions .github/workflows/ci.yaml

This file was deleted.

29 changes: 7 additions & 22 deletions .github/workflows/quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:
- '*.lua'
- '.luarc.json'
- '*.toml'
- 'vim.yaml'
markdown:
- '*.md'
- 'doc/**/*.md'
Expand All @@ -35,11 +36,8 @@ jobs:
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- uses: JohnnyMorganz/stylua-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: 2.1.0
args: --check .
- uses: cachix/install-nix-action@v31
- run: nix develop --command stylua --check .

lua-lint:
name: Lua Lint Check
Expand All @@ -48,11 +46,8 @@ jobs:
if: ${{ needs.changes.outputs.lua == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Lint with Selene
uses: NTBBloodbath/selene-action@v1.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --display-style quiet .
- uses: cachix/install-nix-action@v31
- run: nix develop --command selene --display-style quiet .

lua-typecheck:
name: Lua Type Check
Expand All @@ -75,15 +70,5 @@ jobs:
if: ${{ needs.changes.outputs.markdown == 'true' }}
steps:
- uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install prettier
run: pnpm add -g prettier@3.1.0
- name: Check markdown formatting with prettier
run: prettier --check .
- uses: cachix/install-nix-action@v31
- run: nix develop --command prettier --check .
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ doc/tags
CLAUDE.md
.claude/
node_modules/

.envrc
.direnv
2 changes: 1 addition & 1 deletion .luarc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"runtime.version": "Lua 5.1",
"runtime.version": "LuaJIT",
"runtime.path": ["lua/?.lua", "lua/?/init.lua"],
"diagnostics.globals": ["vim"],
"workspace.library": ["$VIMRUNTIME/lua", "${3rd}/luv/library"],
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ repos:
hooks:
- id: prettier
name: prettier
files: \.(md|toml|ya?ml|sh)$
files: \.(md|toml|yaml|yml|sh)$
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# live-server.nvim

Live reload HTML, CSS, and JavaScript files inside Neovim with the power of
[live-server](https://www.npmjs.com/package/live-server).
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

Expand All @@ -12,12 +17,17 @@ Install with your package manager or via
luarocks install live-server.nvim
```

## Dependencies

- [live-server](https://www.npmjs.com/package/live-server) (install globally via npm/yarn)

## Documentation

```vim
: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](https://github.com/libuv/libuv/issues/1778).
48 changes: 40 additions & 8 deletions doc/live-server.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ Homepage: <https://github.com/barrettruth/live-server.nvim>
INTRODUCTION *live-server.nvim*

live-server.nvim automatically reloads HTML, CSS, and JavaScript files in the
browser via a local development server.
browser via a local development server. No external dependencies required —
the server runs entirely in Lua using Neovim's built-in libuv bindings.

===============================================================================
REQUIREMENTS *live-server-requirements*

- Neovim >= 0.9.0
- live-server npm package (`npm install -g live-server`)
- Neovim >= 0.10

===============================================================================
CONFIGURATION *live-server-config*
Expand All @@ -22,15 +22,23 @@ CONFIGURATION *live-server-config*
Configure via `vim.g.live_server` before the plugin loads: >lua

vim.g.live_server = {
args = { '--port=8080', '--no-browser' },
port = 8080,
browser = false,
}
<
*live_server.Config*
Fields: ~

{args} (`string[]`) Arguments passed to live-server via |vim.fn.jobstart()|.
Run `live-server --help` to see available options.
Default: `{ '--port=5555' }`
{port} (`integer?`) Port for the HTTP server. Default: `5500`
{browser} (`boolean?`) Auto-open browser on start. Default: `true`
{debounce} (`integer?`) Debounce interval in ms for file changes.
Default: `120`
{ignore} (`string[]?`) Lua patterns for file paths to ignore when
watching for changes. Default: `{}`
{css_inject} (`boolean?`) Hot-swap CSS without full page reload.
Default: `true`
{debug} (`boolean?`) Log each step of the hot-reload chain via
|vim.notify()| at DEBUG level. Default: `false`

===============================================================================
COMMANDS *live-server-commands*
Expand Down Expand Up @@ -113,8 +121,32 @@ Lua keybinding to toggle server: >lua
Configuration with custom port and no auto-open: >lua

vim.g.live_server = {
args = { '--port=3000', '--no-browser' },
port = 3000,
browser = false,
}
<
Ignore node_modules and dotfiles: >lua

vim.g.live_server = {
ignore = { 'node_modules', '^%.' },
}
<
===============================================================================
KNOWN LIMITATIONS *live-server-limitations*

No Recursive File Watching on Linux ~
*live-server-linux-recursive*
libuv's `uv_fs_event` only supports recursive directory watching on macOS
(FSEvents) and Windows (ReadDirectoryChangesW). On Linux, the `recursive`
flag is silently accepted but ignored because inotify does not support it
natively. Only files directly in the served root directory trigger
hot-reload; files in subdirectories (e.g. `css/style.css`) will not be
detected.

See https://github.com/libuv/libuv/issues/1778

Enable `debug` in |live-server-config| to verify whether `fs_event`
callbacks fire for a given file change.

-------------------------------------------------------------------------------
vim:tw=78:ft=help:norl:
43 changes: 43 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
description = "live-server.nvim — live reload for web development in Neovim";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
systems.url = "github:nix-systems/default";
};

outputs =
{
nixpkgs,
systems,
...
}:
let
forEachSystem = f: nixpkgs.lib.genAttrs (import systems) (system: f nixpkgs.legacyPackages.${system});
in
{
devShells = forEachSystem (pkgs: {
default = pkgs.mkShell {
packages = [
(pkgs.luajit.withPackages (
ps: with ps; [
busted
nlua
]
))
pkgs.prettier
pkgs.stylua
pkgs.selene
pkgs.lua-language-server
];
};
});
};
}
Loading