live-server.nvim icon indicating copy to clipboard operation
live-server.nvim copied to clipboard

Lazy Config ?

Open chrisfederico1 opened this issue 2 years ago • 6 comments

Hi Aurum ,

This is not an issue but didn't know how to contact you lol . The installation is meant for Packer ? Lazy uses a dependencies key word in replace for a require but in this case it looks like you're not loading another plugin ... Just wanted to know if require should be changed to dependencies when using Lazy Plugin Manager . { "aurum77/live-server.nvim", build = function() require"live_server.util".install() end, cmd = { "LiveServer", "LiveServerStart", "LiveServerStop" }, },

Hopefully you understand lol . I do think it still loads ...

chrisfederico1 avatar Apr 03 '23 15:04 chrisfederico1

hello there, sorry for the really really really late response. I finally took a look at this and it seems like this works:

{
  "aurum77/live-server.nvim",
  config = function()
    require("plugins.live-server")
  end,
  cmd = {
    "LiveServer",
    "LiveServerStart",
    "LiveServerStop",
    "LiveServerInstall",
  },
  build = function()
    require("live_server.util").install()
  end,
},

(don't forget to replace the require inside the config function with your own)

aurum77 avatar Aug 30 '23 09:08 aurum77

Hello, I tried to config the plugin in Lazy and I cannot figure out how to change and say --port and --open. Would you kindly help in providing and example ?

statquant avatar Jul 12 '24 21:07 statquant

Hello, I tried to config the plugin in Lazy and I cannot figure out how to change and say --port and --open. Would you kindly help in providing and example ?

Hello, I think it's supposed to be like this

require("live_server").setup({
	port = 7777,
	browser_command = "firefox",
	quiet = false,
	no_css_inject = true,
})

aurum77 avatar Jul 13 '24 05:07 aurum77

I had the same issue, but unfortunately your solution does not work. After digging into the source code, I found that in the validate function will return false as soon as a user_config parameter is not available or invalid

validate-screenshot

This will have the effect of always falling back to the default according to the setup function

jay-ike avatar Sep 28 '24 14:09 jay-ike

setup-screenshot

jay-ike avatar Sep 28 '24 14:09 jay-ike

so I think to solve it we should provide the configuration properties

jay-ike avatar Sep 28 '24 14:09 jay-ike