From d4b3fa50f3500800ebabba83bb1f2bbf01ffa03e Mon Sep 17 00:00:00 2001 From: Kenji Sakurada Date: Mon, 15 Oct 2018 17:43:01 +0900 Subject: [PATCH] fix: change autocmd event from VimEnter to BufEnter this commit fixes the situation below: 1. open vim without argument(file) 2. :e main.tf 3. didn't load vim-terraform autocmd like :TerraformFmt command --- ftplugin/terraform.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftplugin/terraform.vim b/ftplugin/terraform.vim index 4f1e38f..0e3a7bc 100644 --- a/ftplugin/terraform.vim +++ b/ftplugin/terraform.vim @@ -59,9 +59,9 @@ endfunction augroup terraform autocmd! - autocmd VimEnter * + autocmd BufEnter * \ command! -nargs=+ -complete=custom,s:commands Terraform execute '!terraform '.. ' -no-color' - autocmd VimEnter * command! -nargs=0 TerraformFmt call terraform#fmt() + autocmd BufEnter * command! -nargs=0 TerraformFmt call terraform#fmt() if get(g:, "terraform_fmt_on_save", 1) autocmd BufWritePre *.tf call terraform#fmt() autocmd BufWritePre *.tfvars call terraform#fmt()