nvim/lua/plugins/treesitter.lua

49 lines
918 B
Lua

local config = {
ensure_installed = {
'rust',
'css',
'html',
'javascript',
'jsdoc',
'json',
'lua',
'markdown',
'markdown_inline',
'php',
'python',
'regex',
'styled',
'svelte',
'tsx',
'typescript',
'yaml',
},
highlight = {
enable = true,
use_languagetree = true,
},
indent = {
enable = true,
},
refactor = {
highlight_definitions = { enable = true },
highlight_current_scope = { enable = false },
},
}
return {
'nvim-treesitter/nvim-treesitter',
dependencies = {
'windwp/nvim-ts-autotag',
'JoosepAlviste/nvim-ts-context-commentstring',
'nvim-treesitter/nvim-treesitter-refactor',
},
event = 'BufEnter',
build = ':TSUpdate',
config = function()
require('nvim-treesitter.configs').setup(config)
require('ts_context_commentstring').setup {
enable_autocmd = false,
}
end,
}