From cca2e20907942e9857db8885268108166795c774 Mon Sep 17 00:00:00 2001 From: Michael Peters Date: Mon, 29 Apr 2024 09:58:31 -0700 Subject: [PATCH] use hcl filetype for terraform files --- lua/settings.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lua/settings.lua b/lua/settings.lua index 4ef9cb6..a9d596b 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -42,3 +42,11 @@ vim.api.nvim_create_autocmd('Filetype', { pattern = { 'python', 'sent' }, command = 'setlocal expandtab tabstop=4 shiftwidth=4', }) + +-- use hcl for terraform files +vim.api.nvim_create_augroup('setFiletypeTerraform', { clear = true }) +vim.api.nvim_create_autocmd('Filetype', { + group = 'setExpandTabPython', + pattern = 'terraform', + command = "lua vim.api.nvim_buf_set_option(0, 'filetype', 'hcl')", +})