Open skiss9 opened 2 days ago
Adding a table item to the existing lazy setup call in config/lazy.lua after the { import = "plugins" }
also works, but is not the recommended format. Plugins are meant to be added to the /plugins dir.
-- config/lazy.lua
require("lazy").setup({
spec = {
-- import your plugins
{ import = "plugins" },
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end,
},
},
install = { colorscheme = { "nord" } },
})
In the Installation section, the instructions for lazy.nvim mention adding the following to init.lua:
require("lazy").setup({{"nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}})
But lazy.nvim (latest version v11.14.1) doesn't support this format and throws an error:
Re-sourcing your config is not supported by lazy.nvim
Instead, what works is to add a file (e.g. treesitter.lua) to the /lua/plugins directory, with the following format:
Instructions for adding plugins in lazy.nvim are here: https://lazy.folke.io/installation (bottom of the page) https://lazy.folke.io/spec https://lazy.folke.io/spec/examples