Ⅰ. 插件描述

basic vim/terraform integration

Ⅱ. 基本信息

创建日期:  2014-12-10
更新日期:  2年以前
使用用户:  1292
Github星:  529
插件作者:  HashiVim

Ⅲ. 安装方法


Plugin 'hashivim/vim-terraform-state-of-grace'
… 然后在Vim中运行以下命令:
:source %

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。


NeoBundle 'hashivim/vim-terraform-state-of-grace'
… 然后在Vim中运行以下命令:
:source %


Plug 'hashivim/vim-terraform-state-of-grace'
… 然后在Vim中运行以下命令:
:source %


cd ~/.vim/bundle
git clone

Ⅳ. 文档说明

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.

      • -

Overview: vim-terraform

This plugin adds a :Terraform command that runs terraform, with tab
completion of subcommands. It also sets up *.tf, *.tfvars, and
*.tfstate files to be highlighted as HCL, HCL, and JSON respectively.

      • -


With Vim 8 packages:

git clone ~/.vim/pack/plugins/start/vim-terraform

With Pathogen:

git clone ~/.vim/bundle/vim-terraform

With Vundle, add the following to ~/.vimrc:

Plugin 'hashivim/vim-terraform'
      • -


Allow vim-terraform to align settings automatically with Tabularize.

let g:terraform_align=1

Allow vim-terraform to automatically fold (hide until unfolded) sections of terraform code. Defaults to 0 which is off.

let g:terraform_fold_sections=1

Allow vim-terraform to automatically format *.tf and *.tfvars files with terraform fmt.
You can also do this manually with the :TerraformFmt command.

let g:terraform_fmt_on_save=1
      • -

Updating vim-terraform

Note, this is only for maintainers of the vim-terraform project.

When a new version of Terraform drops, you can run the following where x.x.x is a version such as 0.11.11

./ x.x.x

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.

      • -

Running tests

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 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)

The :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.