nvim-ts-autotag
nvim-ts-autotag copied to clipboard
How to make this plugin work on html.heex templates from Phoenix
Hey, i am using Elixir Phoenix for an Project but this Plugins seems to not really work with heex files.
commenting for visibility! Would also be nice for other embedded languages if erb files for ruby on rails!
I figured it out, I have two separate config files, one to load the plugin and call setup which is lazy loaded
nvim-ts-autotag.lua
return {
"windwp/nvim-ts-autotag",
config = function()
require('nvim-ts-autotag').setup({})
end,
lazy = true
}
and then my nvim-treesitter.lua
has
return {
'nvim-treesitter/nvim-treesitter',
lazy = false,
priority = 999,
build = ":TSUpdate",
cmd = { "TSUpdateSync" },
dependencies = {
"windwp/nvim-ts-autotag",
"tpope/vim-endwise",
"HiPhish/nvim-ts-rainbow2",
"nvim-treesitter/nvim-treesitter-textobjects",
},
config = function()
require 'nvim-treesitter.configs'.setup {
ensure_installed = { "elixir", "heex", "eex", "ruby" },
autotag = {
enable = true,
filetypes = { "html", "xml", "eruby", "heex", "elixir", "embedded_template" },
},
}
end
}(rest of config)
@sharkby7e could you solve the Issue?
@sharkby7e so i could try to add the autotag to nvimtreesitter
@jpx40 yeah that's what fixed it for me!
@sharkby7e Can you help me fix my config? It doesn't work yet. I changed to another file format in Golang templ.
@jpx40 sure, post ur config!
@sharkby7e https://github.com/jpx40/dotfiles/tree/main/dot_config/nvim
It's based on LazyVim, so i kinda don't made the most my self.
@jpx40 I think ur missing the treesitter config. Check out my config here https://github.com/sharkby7e/nvim
@jpx40 did the pr you pushed fix this?
I don't know if the commit is right way since templ is an custom file. I figured out that autotag is pre-configured in Lazyvim. The easiest way would be an fork.
hey guys, not sure if this is the right issue for it, but I'm trying to make autotag work with ~H
sigil inside ex files, but for some reason it does not. I'm using lunarvim and my current config for autotag looks like this:
{
"windwp/nvim-ts-autotag",
config = function()
require("nvim-ts-autotag").setup({
enable = true,
filetypes = { "html", "xml", "eruby", "heex", "elixir", "embedded_template" }
})
end,
lazy = true,
},
any help is greatly appreciated!
@Vagab sry, i still have similar problems my knowledge about this plugin and neovim is not good enough to help you. If i figure something out i will help you.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.