Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

gbprod
Copy link
Contributor

@gbprod gbprod commented Sep 29, 2022

@numToStr
Copy link
Owner

numToStr commented Sep 29, 2022

Is html.twig set by nvim? And what about syntax highlighting?

Edit: I am only able to find setf=twig https://github.com/neovim/neovim/blob/9ca313fb968448011aae0509e6552c52b9f8aa8c/runtime/filetype.vim#L2094

@gbprod
Copy link
Contributor Author

gbprod commented Sep 29, 2022

When I open twig files (without any plugins), neovim set html.twig as filetype. I can't find why looking at Nevim source code...
If I set twigas filetype in ft.lua, it doesn't work at all.

Currently, I use commentstring to make your plugin works on twig files.

Syntax highlight doesn't work without plugins in Neovim but I've made a PR that still not merged to implements treesitter for twig files.

@numToStr
Copy link
Owner

numToStr commented Sep 29, 2022

When I open twig files (without any plugins), neovim set html.twig as filetype.

Interesting, can you try it with nvim --clean? I am just curious as I can't find any reference of html.twig source code and I certainly don't want to add wrong filetype. See #249 (comment)

Syntax highlight doesn't work without plugins in Neovim but I've made a PR that still not merged to implements treesitter for twig files.

Nice 👍

@numToStr
Copy link
Owner

numToStr commented Sep 29, 2022

So, I checked it myself, by default nvim --clean foo.twig sets filetype to twig but there is no highlighting but setting html.twig I get highlighting only on html tags.

Left: set ft=twig | Right: set ft=html.twig

image

@gbprod
Copy link
Contributor Author

gbprod commented Sep 29, 2022

Thanks for the feedback, I've also checked and I found that it's vim-polyglot who set html.twig as filetype. I'll update my code tomorrow!

lua/Comment/ft.lua Outdated Show resolved Hide resolved
@gbprod gbprod requested a review from numToStr September 30, 2022 06:45
lua/Comment/ft.lua Outdated Show resolved Hide resolved
lua/Comment/ft.lua Outdated Show resolved Hide resolved
@numToStr numToStr merged commit d9cfae1 into numToStr:master Sep 30, 2022
@gbprod gbprod deleted the feat-twig branch September 30, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.