From 10a20fd155cc5a77d6a6daa01734893b6f4dba3b Mon Sep 17 00:00:00 2001 From: Stanislav German-Evtushenko Date: Tue, 25 Nov 2025 22:14:06 +0900 Subject: [PATCH] Add support for vars, stack, deploy and search Correctly identify different types of terraform files: - terraform-vars - terraform-stack - terraform-deploy - terraform-search Fixes: - https://github.com/hashicorp/terraform-ls/issues/1838 Refs: - https://github.com/hashicorp/terraform-ls/blob/c20eef80eac1d158e0fc45d7f6de23602104a3f8/docs/language-clients.md#language-ids --- ftdetect/hcl.vim | 6 +++++- ftplugin/terraform-deploy.vim | 1 + ftplugin/terraform-search.vim | 1 + ftplugin/terraform-stack.vim | 1 + ftplugin/terraform-vars.vim | 1 + indent/terraform-deploy.vim | 1 + indent/terraform-search.vim | 1 + indent/terraform-stack.vim | 1 + indent/terraform-vars.vim | 1 + syntax/terraform-deploy.vim | 1 + syntax/terraform-search.vim | 1 + syntax/terraform-stack.vim | 1 + syntax/terraform-vars.vim | 1 + 13 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 ftplugin/terraform-deploy.vim create mode 100644 ftplugin/terraform-search.vim create mode 100644 ftplugin/terraform-stack.vim create mode 100644 ftplugin/terraform-vars.vim create mode 100644 indent/terraform-deploy.vim create mode 100644 indent/terraform-search.vim create mode 100644 indent/terraform-stack.vim create mode 100644 indent/terraform-vars.vim create mode 100644 syntax/terraform-deploy.vim create mode 100644 syntax/terraform-search.vim create mode 100644 syntax/terraform-stack.vim create mode 100644 syntax/terraform-vars.vim diff --git a/ftdetect/hcl.vim b/ftdetect/hcl.vim index 978a828..84e6004 100644 --- a/ftdetect/hcl.vim +++ b/ftdetect/hcl.vim @@ -3,5 +3,9 @@ silent! autocmd! filetypedetect BufRead,BufNewFile *.tf autocmd BufRead,BufNewFile *.hcl,*.tfbackend set filetype=hcl autocmd BufRead,BufNewFile .terraformrc,terraform.rc set filetype=hcl -autocmd BufRead,BufNewFile *.tf,*.tofu,*.tfvars,*.tftest.hcl,*.tofutest.hcl set filetype=terraform +autocmd BufRead,BufNewFile *.tfcomponent.hcl,*.tfstack.hcl set filetype=terraform-stack +autocmd BufRead,BufNewFile *.tfdeploy.hcl set filetype=terraform-deploy +autocmd BufRead,BufNewFile *.tfquery.hcl set filetype=terraform-search +autocmd BufRead,BufNewFile *.tfvars set filetype=terraform-vars +autocmd BufRead,BufNewFile *.tf,*.tofu,*.tftest.hcl,*.tofutest.hcl set filetype=terraform autocmd BufRead,BufNewFile *.tfstate,*.tfstate.backup set filetype=json diff --git a/ftplugin/terraform-deploy.vim b/ftplugin/terraform-deploy.vim new file mode 100644 index 0000000..5e38f54 --- /dev/null +++ b/ftplugin/terraform-deploy.vim @@ -0,0 +1 @@ +runtime! ftplugin/terraform.vim diff --git a/ftplugin/terraform-search.vim b/ftplugin/terraform-search.vim new file mode 100644 index 0000000..5e38f54 --- /dev/null +++ b/ftplugin/terraform-search.vim @@ -0,0 +1 @@ +runtime! ftplugin/terraform.vim diff --git a/ftplugin/terraform-stack.vim b/ftplugin/terraform-stack.vim new file mode 100644 index 0000000..5e38f54 --- /dev/null +++ b/ftplugin/terraform-stack.vim @@ -0,0 +1 @@ +runtime! ftplugin/terraform.vim diff --git a/ftplugin/terraform-vars.vim b/ftplugin/terraform-vars.vim new file mode 100644 index 0000000..5e38f54 --- /dev/null +++ b/ftplugin/terraform-vars.vim @@ -0,0 +1 @@ +runtime! ftplugin/terraform.vim diff --git a/indent/terraform-deploy.vim b/indent/terraform-deploy.vim new file mode 100644 index 0000000..b4f7c58 --- /dev/null +++ b/indent/terraform-deploy.vim @@ -0,0 +1 @@ +runtime! indent/terraform.vim diff --git a/indent/terraform-search.vim b/indent/terraform-search.vim new file mode 100644 index 0000000..b4f7c58 --- /dev/null +++ b/indent/terraform-search.vim @@ -0,0 +1 @@ +runtime! indent/terraform.vim diff --git a/indent/terraform-stack.vim b/indent/terraform-stack.vim new file mode 100644 index 0000000..b4f7c58 --- /dev/null +++ b/indent/terraform-stack.vim @@ -0,0 +1 @@ +runtime! indent/terraform.vim diff --git a/indent/terraform-vars.vim b/indent/terraform-vars.vim new file mode 100644 index 0000000..b4f7c58 --- /dev/null +++ b/indent/terraform-vars.vim @@ -0,0 +1 @@ +runtime! indent/terraform.vim diff --git a/syntax/terraform-deploy.vim b/syntax/terraform-deploy.vim new file mode 100644 index 0000000..13caf5a --- /dev/null +++ b/syntax/terraform-deploy.vim @@ -0,0 +1 @@ +runtime! syntax/terraform.vim diff --git a/syntax/terraform-search.vim b/syntax/terraform-search.vim new file mode 100644 index 0000000..13caf5a --- /dev/null +++ b/syntax/terraform-search.vim @@ -0,0 +1 @@ +runtime! syntax/terraform.vim diff --git a/syntax/terraform-stack.vim b/syntax/terraform-stack.vim new file mode 100644 index 0000000..13caf5a --- /dev/null +++ b/syntax/terraform-stack.vim @@ -0,0 +1 @@ +runtime! syntax/terraform.vim diff --git a/syntax/terraform-vars.vim b/syntax/terraform-vars.vim new file mode 100644 index 0000000..13caf5a --- /dev/null +++ b/syntax/terraform-vars.vim @@ -0,0 +1 @@ +runtime! syntax/terraform.vim