terraform-vim-folding


Ⅰ. 插件描述

Fold up your Terraform code for easier editing in vim

Ⅱ. 基本信息

创建日期:  2016-01-04
使用用户:  1
Github星:  1
插件作者:  Jason Gerry

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'jgerry/terraform-vim-folding'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'jgerry/terraform-vim-folding'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'jgerry/terraform-vim-folding'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/jgerry/terraform-vim-folding

Ⅳ. 文档说明

I love using Terraform but the files contain so much stuff! This filetype plugin causes individual resources to default to being folded up onto a single line. I find it much easier to digest Terraform code this way. Maybe you will too.

First, set up your .tf filetype in your .vimrc:

au BufRead,BufNewFile *.tf setlocal filetype=terraform

Create the following directory, if you don't already have it

mkdir -p ~/.vim/after/ftplugin

Then put terraform.vim in that directory. By default every .tf file opens already folded. If you want to change that behavior just change foldlevel=1 (or > 1).

Right now this folds resource, provider, module, data, output, terraform, and variable stanzas. There may be more here in the future.

screenshot

添加新评论