1
0
mirror of https://github.com/dcarrillo/dotfiles.git synced 2025-07-01 19:49:25 +00:00

[neovim] Format hcl files on save

This commit is contained in:
2024-09-26 20:21:33 +02:00
parent 32417a0bce
commit 6c42fb1c09
2 changed files with 6 additions and 1 deletions

View File

@ -8,6 +8,7 @@ require("conform").setup({
python = { "isort", "black" },
typescript = { "prettier" },
yaml = { "prettier" },
hcl = { "terraform_fmt" },
},
formatters = {
{
@ -16,7 +17,7 @@ require("conform").setup({
},
},
format_on_save = function(bufnr)
local filetypes = { "go", "typescript", "lua" }
local filetypes = { "go", "typescript", "lua", "hcl" }
if not vim.tbl_contains(filetypes, vim.bo[bufnr].filetype) then
return
end