use({
"aurum77/live-server.nvim",
run = function()
require"live_server.util".install()
end,
cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" },
})
Runs when you call :LiveServer
Default:
local status_ok, live_server = pcall(require, "live_server")
if not status_ok then
return
end
live_server.setup({
port = 8080,
browser_command = "", -- Empty string starts up with default browser
quiet = false,
no_css_inject = false, -- Disables css injection if true, might be useful when testing out tailwindcss
install_path = vim.fn.stdpath "config" .. "/live-server/",
})
Example:
local status_ok, live_server = pcall(require, "live_server")
if not status_ok then
return
end
live_server.setup({
port = 7567,
browser_command = "firefox", -- Command or executable path
quiet = false,
no_css_inject = true,
install_path = os.getenv("HOME") .. "/live/",
})
- npm
This plugin installs live-server to
:lua print(vim.fn.stdpath("data") .. "/live-server/")
The initial implementation took about a day since I am quite new to Lua and Neovim programming / API
I was bored of Javascript and wanted to learn about creating plugins for Neovim using Lua, also I wasn't able to find plugins that would work similarly to this one!
- 1-1 feature parity with VSCode's Live Server extension
I like cats ๐ฑ Feel free to open a pull request or give recommendations to au#4829 on Discord
Neovim Lua Plugin From Scratch