Custom nvim indents for various filetypes

This commit is contained in:
don philipe
2025-04-23 22:02:28 +02:00
parent 9803f705e4
commit f078314b0d
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
vim.api.nvim_create_autocmd('Filetype', {
pattern = {
'xml',
'html',
'xhtml',
'css',
'scss',
'javascript',
'typescript',
'lua',
'jsx',
'tsx',
'typescriptreact',
'javascriptreact',
'htmldjango'
},
command = 'setlocal shiftwidth=4 tabstop=4 expandtab'
})
vim.api.nvim_create_autocmd('Filetype', {
pattern = { 'yaml',
},
command = 'setlocal shiftwidth=2 tabstop=2 expandtab'
})

View File

@@ -34,4 +34,9 @@ require'nvim-treesitter.configs'.setup {
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
-- indent with treesitter is currently experimental, just mark text and hit "="
indent = {
enable = true,
},
}