Call For Maintainers
This plugin, along with others like it, is now maintained by the HashiVim organization, which is looking for additional maintainers and contributors. See the HashiVim home page for further information.
This plugin adds a
:Terraform command that runs terraform, with tab completion
It also sets up
terraform.rc files to
be highlighted as HCL and
*.tfstate as JSON.
With Vim 8 packages:
git clone https://github.com/hashivim/vim-terraform.git ~/.vim/pack/plugins/start/vim-terraform
git clone https://github.com/hashivim/vim-terraform.git ~/.vim/bundle/vim-terraform
With Vundle, add the following to
Allow vim-terraform to align settings automatically with Tabularize.
Allow vim-terraform to automatically fold (hide until unfolded) sections of terraform code. Defaults to 0 which is off.
Allow vim-terraform to automatically format
*.tfvars files with
You can also do this manually with the
Allow vim-terraform to use a custom path for the terraform binary. Defaults to terraform (found in $PATH)
Use with other HCL files
This is a terraform plugin, with terraform-specific features. However, some users have reported that it also works well for other files that use the Hashicorp Configuration Language.
If you want to use this plugin for non-terraform files, the simplest way is to
teach vim to treat them as terraform.
For example to use this plugin for files with suffix
.hcl, put the following
autocmd BufRead,BufNewFile *.hcl set filetype=terraform
Note, this is only for maintainers of the
When a new version of Terraform drops, you can run the following where x.x.x is a version such as 0.11.11
At this point, add the modified files to a git branch and open a pull request.
git checkout -b "feature/update-to-terraform-$VERSION" git add $FILE git commit -m "Message about update" git push
Add another maintainer to the pull request and await confirmation.
To run the test suite and verify functionality
Syntax highlighting and indentation by Kevin Le (@bkad) based on prior work by Larry Gilbert (@L2G). The rest originally written by Mark Cornick https://www.markcornick.com/ and contributors listed below. Licensed under the ISC license.
Thanks to the following contributors:
- michael j talarczyk (@mijit)
- Koji Nakayama (@knakayama)
- Kris (@kostecky)
- Okumura Takahiro (@hfm)
- Paul Forman (@pforman)
- Lowe Schmidt (@lsc)
- Mario Kozjak (@mkozjak)
:TerraformFmt command is adapted from
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.