Treesitter update

This commit is contained in:
Chris
2025-12-10 14:19:07 +00:00
parent d53821dbf7
commit a086657031
4 changed files with 198 additions and 107 deletions

View File

@@ -30,7 +30,7 @@ vim.api.nvim_create_autocmd('SwapExists', {
desc = 'Always choose to delete the swap file, files are saved automatically',
group = vim.api.nvim_create_augroup('NoSwaps', { clear = true }),
callback = function(args)
vim.cmd("let v:swapchoice = 'd'")
vim.cmd "let v:swapchoice = 'd'"
end,
})
@@ -116,4 +116,33 @@ vim.api.nvim_create_autocmd('BufWritePost', {
end,
})
vim.api.nvim_create_autocmd('FileType', {
pattern = {
'bash',
'c',
'diff',
'html',
'lua',
'luadoc',
'markdown',
'markdown_inline',
'query',
'vim',
'vimdoc',
'php',
'javascript',
'typescript',
'json',
},
callback = function()
-- syntax highlighting, provided by Neovim
vim.treesitter.start()
-- folds, provided by Neovim
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
vim.wo.foldmethod = 'expr'
-- indentation, provided by nvim-treesitter
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
end,
})
require('helpers').edit_cf('a', '/lua/autocmd.lua')