local M = {}
|
|
|
|
M.install = { src = "https://github.com/nvim-treesitter/nvim-treesitter", version = "main" }
|
|
|
|
M.setup = function()
|
|
require("nvim-treesitter").setup {
|
|
install_dir = vim.fn.stdpath('data') .. '/site',
|
|
indent = {
|
|
enable = true,
|
|
},
|
|
}
|
|
|
|
-- Install parsers
|
|
require('nvim-treesitter').install({
|
|
'json',
|
|
'javascript',
|
|
'typescript',
|
|
'tsx',
|
|
'yaml',
|
|
'html',
|
|
'css',
|
|
'markdown',
|
|
'markdown_inline',
|
|
'bash',
|
|
'lua',
|
|
'vim',
|
|
'dockerfile',
|
|
'gitignore',
|
|
'php',
|
|
'latex',
|
|
'blade'
|
|
})
|
|
|
|
vim.api.nvim_create_autocmd('FileType', {
|
|
pattern = {
|
|
'php',
|
|
'ts',
|
|
'vue',
|
|
},
|
|
callback = function() vim.treesitter.start() end,
|
|
})
|
|
end
|
|
|
|
return M
|