Skip to content
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

Can't configure gohtmltmpl comments correctly #65

Open
mrjones2014 opened this issue Aug 26, 2021 · 2 comments
Open

Can't configure gohtmltmpl comments correctly #65

mrjones2014 opened this issue Aug 26, 2021 · 2 comments
Labels
support A support request

Comments

@mrjones2014
Copy link

mrjones2014 commented Aug 26, 2021

When I use this config:

config.configure_language('default', {
  use_consistent_indentation = true,
  ignore_whitespace = true,
})
config.configure_language('gohtmltmpl', {
  prefer_multi_line_comments = true,
  single_line_comment_string = false,
  multi_line_comment_string = { '{{/*', '*/}}' },
})

And trigger kommentary in a gohtmltmpl file, it uses just /* */ as the comment string.

@b3nj5m1n
Copy link
Owner

Hi, thanks for reporting.

What exactly is the extension of a gohtmltmpl file? Because when I open a file with the extension .gohtmltmpl, the filetype in nvim is set to nothing.

Try set filetype? in nvim and see if the filetype is actually called gohtmltmpl, if it's called something else simply change the name in the config, if the filetype is not set for these files, you should be able to define it with something like this autocmd BufRead,BufNewFile *.gohtmltmpl set filetype=gohtmltmpl in your init.vim.

Let me know if that helps.

@b3nj5m1n b3nj5m1n added the support A support request label Aug 26, 2021
@mrjones2014
Copy link
Author

Sorry for the missing detail. gohtmltmpl is the filetype set by the vim-go plugin, for templates to be used with the Go HTML template package. Basically it uses {{ }} for Go code (not really Go code, more like a DSL) interpolation.

I have some custom detection code that, when opening a .html file, if the file contains {{ and }}, it overrides the filetype to gohtmltmpl.

Running set filetype? returns gohtmltmpl with this in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support A support request
Projects
None yet
Development

No branches or pull requests

2 participants