New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.tf filetype detection seems broken in more recent Vim/NeoVim versions? #179
Comments
filetype detection is executed from https://github.com/vim/vim/blob/be19d78c3d44221cbc38fbb5bac19302345c1def/runtime/filetype.vim#L2745, which is already inside a group: it is correct not to add another group in our own file.
#133 was a bit similar, the reporter in that was using a plugin manager that messed with the runtime path and not following the associated instructions correctly. Perhaps you're doing something similar? |
I see, thanks for the explanation and the links! I haven't figured out exactly what's causing this yet but as you explained this plugin is doing everything correctly, so I'll close the ticket. |
All right, for anyone who has the same issue in the future, the source of the bug in my case was another plugin's (vimoutliner) I'm sure this is not the only plugin that does this, so again for anyone who has the same issue, it probably makes sense to go into your Vim plugin folder and run What pointed me towards this being a potential cause was this comment in Vim's |
I'm running NeoVim 0.7.2 with this plugin installed via vim-plug, but when I open a
.tf
file, the filetype is just empty. It works fine for.hcl
files.Curiously, if I comment out this line where you disable Vim's native
.ft
filetype detection, it works. But that seems to be because recent versions of Vim are able to recognize.tf
files as Terraform, so with this line removed, Vim's native detection kicks in and sets the filetype:So that can't be the underlying issue (although it would probably make sense to have a condition there to let Vim handle this for recent versions, because then users who want to be able to detect both file types denoted by
.tf
can do so).Based on Vim's own autocmd being in group
filetypedetect
, I tried addingfiletypedetect
as the group for the four autocmds setup by vim-terraform, and that made it detect the filetype correctly as well. But there is probably a reason why you don't havefiletypedetect
as the group there, so let me know what you think.The text was updated successfully, but these errors were encountered: