Replace setup() with vim.g.live_server configuration. Add plugin/ file with load guard and user commands for proper lazy loading.
16 lines
471 B
Lua
16 lines
471 B
Lua
if vim.g.loaded_live_server then
|
|
return
|
|
end
|
|
vim.g.loaded_live_server = 1
|
|
|
|
vim.api.nvim_create_user_command('LiveServerStart', function(opts)
|
|
require('live-server').start(opts.args)
|
|
end, { nargs = '?' })
|
|
|
|
vim.api.nvim_create_user_command('LiveServerStop', function(opts)
|
|
require('live-server').stop(opts.args)
|
|
end, { nargs = '?' })
|
|
|
|
vim.api.nvim_create_user_command('LiveServerToggle', function(opts)
|
|
require('live-server').toggle(opts.args)
|
|
end, { nargs = '?' })
|