From 78b54bb47b288e38f5e2a481c3f8652b276b012b Mon Sep 17 00:00:00 2001 From: Eric Torres Date: Sun, 3 Aug 2025 20:33:13 -0700 Subject: [PATCH] nvim: configure Neoformat for tfvars files --- nvim/.config/nvim/plugins.vim | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/nvim/.config/nvim/plugins.vim b/nvim/.config/nvim/plugins.vim index 4c9b4e8..e248352 100644 --- a/nvim/.config/nvim/plugins.vim +++ b/nvim/.config/nvim/plugins.vim @@ -143,3 +143,16 @@ let g:neoformat_basic_format_trim = 1 " For shell formatting let g:shfmt_opt="-ci -i 4 -sr" + +" Terraform tfvars files +let g:neoformat_tfvars_terraform = { + \ 'exe': 'terraform', + \ 'args': ['fmt', '-'], + \ 'stdin': 1, + \ } + +" Associate .tfvars with the 'tfvars' filetype if not already set +autocmd BufRead,BufNewFile *.tfvars set filetype=tfvars + +" Enable neoformat for .tfvars using terraform fmt +let g:neoformat_enabled_tfvars = ['terraform']