1
0
mirror of https://github.com/danbee/dotfiles-local synced 2025-03-04 08:49:07 +00:00

Fix Treesitter config

This commit is contained in:
Daniel Barber 2023-04-25 14:29:52 -05:00 committed by Dan Barber
parent 8ccc95f84e
commit d9a16ecf09
3 changed files with 44 additions and 43 deletions

View File

@ -2,6 +2,8 @@ require("onedark").load()
local indent = 2 local indent = 2
vim.opt.updatetime = 100
-- Tabstops -- Tabstops
vim.opt.expandtab = true vim.opt.expandtab = true
vim.opt.shiftwidth = indent vim.opt.shiftwidth = indent

View File

@ -1,36 +1,39 @@
return { return function()
highlight = { enable = true }, require("nvim-treesitter.configs").setup({
indent = { enable = true }, highlight = { enable = true },
context_commentstring = { enable = true, enable_autocmd = false }, indent = { enable = true },
ensure_installed = { context_commentstring = { enable = true },
"bash", auto_install = true,
"c", sync_install = false,
"css", ensure_installed = {
"dockerfile", "bash",
"eex", "c",
"elixir", "css",
"help", "dockerfile",
"html", "eex",
"javascript", "elixir",
"json", "html",
"lua", "javascript",
"luadoc", "json",
"luap", "lua",
"markdown", "luadoc",
"markdown_inline", "luap",
"python", "markdown",
"query", "markdown_inline",
"regex", "python",
"ruby", "query",
"rust", "regex",
"scss", "ruby",
"sql", "rust",
"swift", "scss",
"toml", "sql",
"tsx", "swift",
"typescript", "toml",
"vim", "tsx",
"vue", "typescript",
"yaml", "vim",
}, "vue",
} "yaml",
},
})
end

View File

@ -1,18 +1,15 @@
return { return {
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
event = { "BufReadPost", "BufNewFile" }, event = { "BufReadPost", "BufNewFile" },
dependencies = { dependencies = {
{ {
"nvim-treesitter/nvim-treesitter-textobjects", "nvim-treesitter/nvim-treesitter-textobjects",
init = function() init = function()
-- PERF: no need to load the plugin, if we only need its queries for mini.ai -- PERF: no need to load the plugin, if we only need its queries for mini.ai
local plugin = local plugin =
require("lazy.core.config").spec.plugins["nvim-treesitter"] require("lazy.core.config").spec.plugins["nvim-treesitter"]
local opts = require("lazy.core.plugin").values(plugin, "opts", false) local opts = require("lazy.core.plugin").values(plugin, "opts", false)
local enabled = false local enabled = false
if opts.textobjects then if opts.textobjects then
@ -30,9 +27,8 @@ return {
end end
end, end,
}, },
"JoosepAlviste/nvim-ts-context-commentstring",
}, },
config = require("config.plugins.tree-sitter"),
---@type TSConfig
opts = require("config.plugins.tree-sitter"),
}, },
} }