add proper angular support

This commit is contained in:
Zoty 2026-04-13 16:55:07 -03:00
parent ae9aa49359
commit 33a5bd4b2a
Signed by: Zoty
SSH key fingerprint: SHA256:WsGEGivgl37t3Mth6uugXMOgMCTR7QolIepNbC+j/tA
3 changed files with 14 additions and 3 deletions

View file

@ -32,16 +32,29 @@ return {
'astro',
'vue',
'java',
'angular',
}
for _, parser in ipairs(parsers) do
ts.install(parser)
end
-- Detect Angular HTML templates and set filetype to htmlangular
vim.api.nvim_create_autocmd('FileType', {
pattern = 'html',
callback = function(ev)
local root = vim.fs.root(ev.buf, { 'angular.json' })
if root then
vim.bo[ev.buf].filetype = 'htmlangular'
end
end,
})
-- Filetypes whose name differs from the parser name
local ft_to_parser = {
typescriptreact = 'tsx',
javascriptreact = 'jsx',
htmlangular = 'angular',
}
vim.api.nvim_create_autocmd('FileType', {

View file

@ -47,5 +47,3 @@ vim.diagnostic.config({
update_in_insert = false, -- update diagnostics in insert mod
severity_sort = true, -- sort diagnostics by severity
})
require('vim._core.ui2').enable({})