aboutsummaryrefslogtreecommitdiffstats
path: root/lua/plugins/treesitter.lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins/treesitter.lua')
-rw-r--r--lua/plugins/treesitter.lua130
1 files changed, 46 insertions, 84 deletions
diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua
index ba55910..35db83a 100644
--- a/lua/plugins/treesitter.lua
+++ b/lua/plugins/treesitter.lua
@@ -2,94 +2,56 @@ return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
dependencies = {
- "nvim-treesitter/playground",
- { "nvim-treesitter/nvim-treesitter-refactor", enabled = false },
"nvim-treesitter/nvim-treesitter-textobjects",
},
- config = function()
- require("nvim-treesitter.configs").setup {
- ensure_installed = {
- "bash",
- "css",
- "go",
- "gomod",
- "html",
- "javascript",
- "json",
- "lua",
- "luadoc",
- "markdown",
- "markdown_inline",
- "nix",
- "org",
- "php",
- "phpdoc",
- "query",
- "rust",
- "sql",
- "svelte",
- "typescript",
- "regex",
- "vim",
- "yaml",
- },
- highlight = {
- enable = true,
- additional_vim_regex_highlighting = { "org" },
- },
- indent = {
- enable = true,
- },
- incremental_selection = {
+ event = "VeryLazy",
+ main = "nvim-treesitter.configs",
+ opts = {
+ ensure_installed = {
+ "bash",
+ "css",
+ "go",
+ "gomod",
+ "html",
+ "javascript",
+ "json",
+ "lua",
+ "luadoc",
+ "markdown",
+ "markdown_inline",
+ "nix",
+ "org",
+ "php",
+ "phpdoc",
+ "query",
+ "rust",
+ "sql",
+ "svelte",
+ "typescript",
+ "regex",
+ "vim",
+ "yaml",
+ },
+ highlight = {
+ enable = true,
+ additional_vim_regex_highlighting = { "org" },
+ },
+ indent = {
+ enable = true,
+ },
+ textobjects = {
+ select = {
enable = true,
+ lookahead = true,
keymaps = {
- init_selection = "gnn",
- node_incremental = "grn",
- scope_incremental = "grc",
- node_decremental = "grm",
+ ["af"] = "@function.outer",
+ ["if"] = "@function.inner",
+ ["ac"] = "@conditional.outer",
+ ["ic"] = "@conditional.inner",
+ ["al"] = "@loop.outer",
+ ["il"] = "@loop.inner",
},
},
- -- refactor = {
- -- highlight_definitions = { enable = true },
- -- smart_rename = {
- -- enable = false,
- -- keymaps = {
- -- smart_rename = "trr",
- -- },
- -- },
- -- },
- textobjects = {
- select = {
- enable = true,
- lookahead = true,
- keymaps = {
- ["af"] = "@function.outer",
- ["if"] = "@function.inner",
- ["ac"] = "@conditional.outer",
- ["ic"] = "@conditional.inner",
- ["al"] = "@loop.outer",
- ["il"] = "@loop.inner",
- },
- },
- },
- playground = {
- enable = true,
- disable = {},
- updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code
- persist_queries = false, -- Whether the query persists across vim sessions
- keybindings = {
- toggle_query_editor = "o",
- toggle_hl_groups = "i",
- toggle_injected_languages = "t",
- toggle_anonymous_nodes = "a",
- toggle_language_display = "I",
- focus_language = "f",
- unfocus_language = "F",
- update = "R",
- goto_node = "<cr>",
- show_help = "?",
- },
- },
- }
- end,
+ },
+ },
}