nvim/lua/cosmic/plugins/treesitter/init.lua
Matthew Leong daaafc1f8d
Lazy.nvim (#88)
* feat: init lazy.nvim

* refactor: easy plugin init

* feat: user defined plugins

* refactor: clean up user config

* refactor: clean up lsp plugins

* fix: lsp signature

* fix: null ls user config

* feat: replace commands

* feat: optimize lazy loading

* fix: lsp_signature working

* fix: documentation hover/sig help

* fix: autopairs

* feat: clean up luasnips

* fix auto complete

* moar laziness

* feat: add markdown_inline to ensured_installed for TS

* clean up

* clean up auto-session
2022-12-29 08:34:17 -08:00

55 lines
1.1 KiB
Lua

local user_config = require('cosmic.core.user')
local u = require('cosmic.utils')
local defaults = {
ensure_installed = {
'astro',
'css',
'html',
'javascript',
'jsdoc',
'json',
'lua',
'markdown',
'markdown_inline',
'php',
'python',
'regex',
'scss',
'tsx',
'typescript',
},
highlight = {
enable = true,
use_languagetree = true,
},
indent = {
enable = true,
},
autotag = {
enable = true,
},
context_commentstring = {
enable = true,
enable_autocmd = false,
},
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(u.merge(defaults, user_config.plugins.treesitter or {}))
end,
enabled = not vim.tbl_contains(user_config.disable_builtin_plugins, 'treesitter'),
}