Giter Club home page Giter Club logo

Comments (13)

jvirtanen avatar jvirtanen commented on May 25, 2024

Hi @mattleong! Yes, with this plugin you should end up with the file type nomad and the syntax hcl. The file type/syntax split is there to improve interoperability with other Vim plugins that might work specifically with either Nomad or Terraform files.

What does set filetype say to you on one of these files? What about set syntax? Do you use some other Vim plugins that might apply to Nomad files?

from vim-hcl.

hanshasselberg avatar hanshasselberg commented on May 25, 2024

set filetype says nomad. set syntax says nomad as well.

from vim-hcl.

jvirtanen avatar jvirtanen commented on May 25, 2024

Do you use some other Vim plugins that could perhaps set syntax=nomad for filetype nomad?

from vim-hcl.

hanshasselberg avatar hanshasselberg commented on May 25, 2024

Is there a way to find out how that got set?

from vim-hcl.

mattleong avatar mattleong commented on May 25, 2024

Do you use some other Vim plugins that could perhaps set syntax=nomad for filetype nomad?

Confirming that I do not use any other plugins that would do that.

from vim-hcl.

jvirtanen avatar jvirtanen commented on May 25, 2024

Which Vim versions are you two using?

from vim-hcl.

jvirtanen avatar jvirtanen commented on May 25, 2024

Is there a way to find out how that got set?

Yes, I just learned that there is. Give the command :verbose set syntax? to see what last set syntax.

from vim-hcl.

jvirtanen avatar jvirtanen commented on May 25, 2024

@mattleong @i0rek Did you test :verbose set syntax? to see what last set syntax on a Nomad file?

from vim-hcl.

orlvn avatar orlvn commented on May 25, 2024

Just to add that the same is happening to me, but for Terraform files (.tf), while Terragrunt (.hcl) are working fine (I don't use Nomad).
When I manualy set ft=hcl, this is the output of verbose test:

  syntax=hcl
        Last set from /usr/share/vim/vim82/syntax/syntax.vim line 32

When I just open a .tf file it just says:

syntax=

And there is no highlighting.

System: MacOS with Apple's Vim v8.2

from vim-hcl.

orlvn avatar orlvn commented on May 25, 2024

Oh, and replacing terraform with hcl in ftdetect/hcl.vim:

- autocmd BufNewFile,BufRead *.tf      set filetype=terraform
+ autocmd BufNewFile,BufRead *.tf     set filetype=hcl

Fixes the issue for .tf files.

from vim-hcl.

jvirtanen avatar jvirtanen commented on May 25, 2024

Thank you for the additional details, @orlvn.

I'm also using Vim 8.2, and unfortunately I still cannot reproduce the issue locally. However, I can see that this issue is affecting many. I believe that this issue originated with the commit 13020b3, which started using different filetype and syntax values for Nomad and Terraform. This was in response to #14, which was concerned with the compatibility between this plugin and some other plugins that expected filetype=terraform rather than filetype=hcl for Terraform files.

I will revert that commit for now. I spent some time yesterday studying the built-in plugins in Vim 8.2, and I couldn't find any file formats for which filetype and syntax didn't match. Therefore I think it's safer to just set filetype=hcl (or perhaps start using setfiletype, which does not override an earlier settting) also for Nomad and Terraform files.

from vim-hcl.

jvirtanen avatar jvirtanen commented on May 25, 2024

#18 hopefully solved the issue for all of you.

from vim-hcl.

dR3b avatar dR3b commented on May 25, 2024

Work perfect! Thanks!!!!

from vim-hcl.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.