Skip to content

Commit

Permalink
feat: terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
alpha2phi committed Jul 23, 2023
1 parent 4379238 commit dabe99d
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions lua/pde/terraform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ if not require("config").pde.terraform then
return {}
end

vim.api.nvim_create_autocmd("FileType", {
pattern = { "hcl", "terraform" },
desc = "terraform/hcl commentstring configuration",
command = "setlocal commentstring=#\\ %s",
})

return {
{
"nvim-treesitter/nvim-treesitter",
opts = function(_, opts)
vim.list_extend(opts.ensure_installed, {
"terraform",
"hcl",
})
if type(opts.ensure_installed) == "table" then
vim.list_extend(opts.ensure_installed, {
"terraform",
"hcl",
})
end
end,
},
{
Expand All @@ -23,11 +31,13 @@ return {
{
"jose-elias-alvarez/null-ls.nvim",
opts = function(_, opts)
local null_ls = require "null-ls"
vim.list_extend(opts.sources, {
null_ls.builtins.formatting.terraform_fmt,
null_ls.builtins.diagnostics.terraform_validate,
})
if type(opts.sources) == "table" then
local null_ls = require "null-ls"
vim.list_extend(opts.sources, {
null_ls.builtins.formatting.terraform_fmt,
null_ls.builtins.diagnostics.terraform_validate,
})
end
end,
},
}

0 comments on commit dabe99d

Please sign in to comment.