Skip to main content

Twig

info

You can enable the extra with the :LazyExtras command. Plugins marked as optional will only be configured if they are installed.

Below you can find a list of included plugins and their default settings.

caution

You don't need to copy the default settings to your config. They are only shown here for reference.

nvim-treesitter

opts = { ensure_installed = { "twig" } }

mason.nvim

opts = {
ensure_installed = {
"twigcs",
"twig-cs-fixer",
},
}

nvim-lspconfig

opts = {
servers = {
twiggy_language_server = {
enabled = true,
},
},
}

none-ls.nvim (optional)

opts = function(_, opts)
local nls = require("null-ls")
opts.sources = opts.sources or {}
table.insert(opts.sources, nls.builtins.diagnostics.twigcs)
-- Twig-CS-Fixer builtin not available in none-ls
end

nvim-lint (optional)

opts = {
linters_by_ft = {
twig = { "twigcs" },
},
}

conform.nvim (optional)

opts = {
formatters_by_ft = {
twig = { "twig-cs-fixer" },
},
}