1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00
dotfiles-local/config/nvim/lua/plugins/treesitter.lua
Dan Barber d8a322f404 Starter Neovim config
Featuring syntax highlighting, file tree sidebar, and fuzzy file
finding.
2023-04-05 16:42:29 -05:00

68 lines
1.7 KiB
Lua

return {
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
{
"nvim-treesitter/nvim-treesitter-textobjects",
init = function()
-- PERF: no need to load the plugin, if we only need its queries for mini.ai
local plugin = require("lazy.core.config").spec.plugins["nvim-treesitter"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false)
local enabled = false
if opts.textobjects then
for _, mod in ipairs({ "move", "select", "swap", "lsp_interop" }) do
if opts.textobjects[mod] and opts.textobjects[mod].enable then
enabled = true
break
end
end
end
if not enabled then
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
end
end,
},
},
---@type TSConfig
opts = {
highlight = { enable = true },
indent = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false },
ensure_installed = {
"bash",
"c",
"css",
"dockerfile",
"eex",
"elixir",
"help",
"html",
"javascript",
"json",
"lua",
"luadoc",
"luap",
"markdown",
"markdown_inline",
"python",
"query",
"regex",
"ruby",
"rust",
"scss",
"sql",
"swift",
"toml",
"tsx",
"typescript",
"vim",
"vue",
"yaml",
},
},
},
}