feat(nvim): edit jinja syntax highlighting

This commit is contained in:
matt1432 2025-05-17 02:06:10 -04:00
parent 53ca81b6b0
commit 6ed21eb729
2 changed files with 17 additions and 4 deletions
homeManagerModules/neovim

View file

@ -35,7 +35,16 @@ in {
end; end;
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
pattern = { 'javascript', 'javascriptreact', 'javascript.jsx', 'typescript', 'typescriptreact', 'typescript.tsx', 'css', 'scss' }, pattern = {
'javascript',
'javascriptreact',
'javascript.jsx',
'typescript',
'typescriptreact',
'typescript.tsx',
'css',
'scss',
},
callback = function() callback = function()
vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]]; vim.cmd[[setlocal ts=4 sw=4 sts=0 expandtab]];
@ -44,8 +53,11 @@ in {
end, end,
}); });
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd({ 'FileType', 'BufEnter' }, {
pattern = 'html', pattern = {
'html',
'j2',
},
callback = function() callback = function()
vim.cmd[[setlocal ts=4 sw=4 expandtab]]; vim.cmd[[setlocal ts=4 sw=4 expandtab]];
@ -157,6 +169,7 @@ in {
lsp.html.setup({ lsp.html.setup({
capabilities = html_caps, capabilities = html_caps,
autostart = false, autostart = false,
filetypes = { 'html', 'templ', 'j2', },
settings = { settings = {
configurationSection = { "html", "css", "javascript" }, configurationSection = { "html", "css", "javascript" },

View file

@ -52,7 +52,7 @@ in {
-- --
vim.api.nvim_create_autocmd('BufEnter', { vim.api.nvim_create_autocmd('BufEnter', {
pattern = '*.j2', pattern = '*.j2',
command = "TSBufDisable highlight | LspStop", command = "TSBufDisable highlight",
}); });
''; '';
} }