mirror of
https://github.com/don-philipe/dotfiles.git
synced 2025-11-08 14:47:03 +01:00
Custom nvim indents for various filetypes
This commit is contained in:
23
.config/nvim/lua/config/filetypes.lua
Normal file
23
.config/nvim/lua/config/filetypes.lua
Normal 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'
|
||||
})
|
||||
@@ -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,
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user