jvirtanen/vim-hcl

Syntax highlighting not enable when I open an hcl file

Closed this issue ยท 9 comments

Hello,

I installed your plugin in vim through vundle. It seems to be correctly installed. However the highlighting is not enable when I open an hcl file.
My version of vim is: 8.1.2269.
I have also hashivim/vim-terraform and hashivim/vim-packer installed. I don't know if there is some conflicts here ...

Do you have any ideas where the issue is ?
Thanks.

Hi @smutel! My apologies for the delayed response, I missed the notification on this issue.

What is the file extension for your HCL file? This plugin only recognizes .hcl, .nomad, .tf, and .tfvars. Patches are welcome for any other HashiCorp standard extensions that are currently missing. ๐Ÿ™‚

Assuming the file extension is recognized, what does Vim say when you issue the command :set filetype while having a HCL file open?

My file is called template.pkr.hcl. I added this line in ~/.vim/bundle/vim-hcl/ftdetect/hcl.vim:

autocmd BufNewFile,BufRead *.pkr.hcl set filetype=hcl

but it does not seem to work.

More info on this extension here: https://www.hashicorp.com/resources/hashicorp-packer-with-hcl-configs

The .pkr.hcl file extension is already handled by the existing .hcl file extension handling. ๐Ÿ™‚

Can you check what the command :set filetype says when you have this file open?

Only filetype=

Could you try to temporarily disable the other plugins, vim-terraform and vim-packer, to see if there is a conflict?

I disabled the other plugins.
The issue is the same.
Perhaps it's due to my version of vi...?

Perhaps it's due to my version of vi...?

Could be, or something to do with your Vundle setup, which I'm not at all familiar with. I have Vim 8.2, which version are you using?

Sorry, I just noticed your Vim version in the issue description. ๐Ÿ˜œ ๐Ÿ”จ I will check if I can reproduce the problem on that version.

I tested that this plugin works fine on Vim 8.1.2269.