mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 04:21:08 +00:00
Merge 5d8004c2f9 into 459a4c3b10
This commit is contained in:
commit
54e4f1a7a9
1 changed files with 60 additions and 0 deletions
60
lua/lazyvim/plugins/extras/lang/opentofu.lua
Normal file
60
lua/lazyvim/plugins/extras/lang/opentofu.lua
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
vim.filetype.add({
|
||||
extension = {
|
||||
tofu = "opentofu",
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
recommended = function()
|
||||
return LazyVim.extras.wants({
|
||||
ft = "hcl",
|
||||
root = ".tofu",
|
||||
})
|
||||
end,
|
||||
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "terraform", "hcl" })
|
||||
vim.treesitter.language.register("opentofu", "hcl")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
tofu_ls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local null_ls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
null_ls.builtins.formatting.opentofu_fmt,
|
||||
null_ls.builtins.diagnostics.opentofu_validate,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
opentofu = { "tofu" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
opentofu = { "tofu_fmt" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue