Skip to content

barrettruth/live-server.nvim

Repository files navigation

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.

Note

Due to GitHub's historic unreliability, active development is hosted on Forgejo. GitHub is maintained as a read-only mirror. See :help live-server-migration to optionally update your plugin source configuration.

Dependencies

  • Neovim >= 0.10

Installation

With vim.pack (Neovim 0.12+):

vim.pack.add({
  'https://git.barrettruth.com/barrettruth/live-server.nvim',
})

Or via luarocks:

luarocks install live-server.nvim

Quick Start

Set vim.g.live_server before the plugin loads only when you want to change the default port or browser behavior.

vim.g.live_server = {
  port = 8080,
  browser = false,
}

Open an HTML, CSS, or JavaScript file and start the server for that file's directory.

:LiveServerStart

Start a specific project directory when the current buffer is elsewhere.

:LiveServerStart ~/projects/my-website

Use one command to switch the same project on or off.

:LiveServerToggle

Stop the server when you are done with the project.

:LiveServerStop

Documentation

:help live-server

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.

About

[mirror of git.barrettruth.com/barrettruth/live-server.nvim] live reload local development servers inside of neovim

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors