live-server-nvim: plugin to run live-server in neovim
demo-live-server.mov
npm
- install the plugin with lazy.nvim as you would for any other:
require("lazy").setup({
{
"ngtuonghy/live-server-nvim",
event = "VeryLazy",
build = ":LiveServerInstall",
config = functions()
require("live-server-nvim").setup{}
},
})
- live-server-nvim will not run without setup
require('live-server-nvim').setup {
custom = {
"--port=8080",
"--no-css-inject",
},
serverPath = vim.fn.stdpath("data") .. "/live-server/", --default
open = "folder", -- folder|cwd --default
}
LiveServerStart--Run server
LiveServerStop --Stop server
LiveServerToggle --Toggle server
vim.keymap.set("n", "<leader>lt", function() require("live-server-nvim").toggle() end)