1

Neovim plugin: nvim-html-css

I don't know lua but I need this plugin installed for bootstrap classes. I have Neovim NvChad lazy.nvim setup. Copy pasting didn't worked so I tried to cut out maybe harmful parts but it still didn't work.

I tried this but it doesnt seem to be working..

  require("lazy")
    .setup {
      {
        "hrsh7th/nvim-cmp",
        opts = {
          sources = {
            -- other sources
            {
              name = "html-css",
              option = {
                enable_on = {
                  "html",
                }, -- set the file types you want the plugin to work on
                file_extensions = { "css", "sass", "less" }, -- set the local filetypes from which you want to derive classes
                style_sheets = {
                  -- example of remote styles, only css no js for now
                  "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css",
                },
              },
            },
          },
        },
      },
      {
        "Jezda1337/nvim-html-css",
        dependencies = {
          "nvim-treesitter/nvim-treesitter",
          "nvim-lua/plenary.nvim",
        },
        config = function()
          require("html-css"):setup()
        end,
      },
    },
1
  • Did the solution provided solved your problem? How can we help you further? If it does may be could you accept it using the v button next to the arrow voting buttons. It all the question to rest :-) Aug 17, 2023 at 11:43

1 Answer 1

0

I would add the following lines to the the plugins table in the nvim/lua/custom/plugins.lua file:

  {
      "Jezda1337/nvim-html-css",
      dependencies = {
        "nvim-treesitter/nvim-treesitter",
        "nvim-lua/plenary.nvim",
      },
      config = function()
        require("html-css"):setup()
      end,
  },

Here is a link to the NvChad documentation about plugins it is far from exhaustive but I suppose it will improve over time.

2
  • 1
    sadly it didn't worked. pasted that in nvim / lua / custom / plugins.lua and did Lazy sync command but for some reason bootstrap classes still ain't showing up. I do have bootstrap installed via npm and connected to html, but classes still don't show up. I'm not even sure that it even starts. I tried to make current directory directory of the folder I'm working in, but it still doesn't work. Aug 19, 2023 at 11:44
  • Thanks for the feedback :-) I don't know very well the plugin and what to expect. I could suggest other change but in order to test it would be nice if you could provide an example and an expected behavior. Aug 19, 2023 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.