Skip to content

Commit

Permalink
fix: change autocmd event from VimEnter to BufEnter
Browse files Browse the repository at this point in the history
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
  • Loading branch information
kesoji committed Oct 15, 2018
1 parent 7c11252 commit d4b3fa5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ftplugin/terraform.vim
Expand Up @@ -59,9 +59,9 @@ endfunction

augroup terraform
autocmd!
autocmd VimEnter *
autocmd BufEnter *
\ command! -nargs=+ -complete=custom,s:commands Terraform execute '!terraform '.<q-args>. ' -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()
Expand Down

0 comments on commit d4b3fa5

Please sign in to comment.