mirror of
https://github.com/dcarrillo/dotfiles.git
synced 2024-11-14 06:31:12 +00:00
[neovim] Format hcl files on save
This commit is contained in:
parent
32417a0bce
commit
6c42fb1c09
@ -48,6 +48,10 @@ vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
|
||||
]])
|
||||
end,
|
||||
})
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "hcl",
|
||||
command = "setlocal shiftwidth=2 tabstop=2",
|
||||
})
|
||||
|
||||
-- Disable some plugins on very large files
|
||||
vim.api.nvim_create_autocmd({ "BufEnter" }, {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user