diff --git a/lua/shelbybark/plugins/treesitter.lua b/lua/shelbybark/plugins/treesitter.lua index 7b3380a..26caaf4 100644 --- a/lua/shelbybark/plugins/treesitter.lua +++ b/lua/shelbybark/plugins/treesitter.lua @@ -5,14 +5,43 @@ return { lazy = false, priority = 1000, build = ":TSUpdate", + dependencies = { + "nvim-treesitter/nvim-treesitter-textobjects", + }, config = function() require("nvim-treesitter.configs").setup({ ensure_installed = { - "astro", "bash", "c", "css", "diff", "go", "gomod", "gowork", "gosum", - "graphql", "html", "javascript", "jsdoc", "json", "jsonc", "json5", - "lua", "luadoc", "luap", "markdown", "markdown_inline", "python", - "query", "regex", "toml", "tsx", "typescript", "vim", "vimdoc", - "yaml", "ruby", + "astro", + "bash", + "c", + "css", + "diff", + "go", + "gomod", + "gowork", + "gosum", + "graphql", + "html", + "javascript", + "jsdoc", + "json", + "jsonc", + "json5", + "lua", + "luadoc", + "luap", + "markdown", + "markdown_inline", + "python", + "query", + "regex", + "toml", + "tsx", + "typescript", + "vim", + "vimdoc", + "yaml", + "ruby", }, sync_install = false, auto_install = true, @@ -30,6 +59,18 @@ return { node_decremental = "", }, }, + textobjects = { + select = { + enable = true, + lookahead = true, + keymaps = { + ["af"] = "@function.outer", + ["if"] = "@function.inner", + ["ac"] = "@class.outer", + ["ic"] = "@class.inner", + }, + }, + }, }) end, }, @@ -41,21 +82,4 @@ return { multiwindow = true, }, }, - { - "nvim-treesitter/nvim-treesitter-textobjects", - event = "BufReadPre", - dependencies = { "nvim-treesitter/nvim-treesitter" }, - opts = { - select = { - enable = true, - lookahead = true, - keymaps = { - ["af"] = "@function.outer", - ["if"] = "@function.inner", - ["ac"] = "@class.outer", - ["ic"] = "@class.inner", - }, - }, - }, - }, }