diff options
| author | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-09-03 12:09:14 +0200 |
|---|---|---|
| committer | Ariel D'Alessandro <dalessandro.ariel@gmail.com> | 2023-09-03 12:09:14 +0200 |
| commit | 26f078de81ee51f1fb91a5d4f5dc7837515ab8c0 (patch) | |
| tree | 2fb6aeb92245ca34b111d2536e7a2c4940a06716 /lua/plugins/treesitter.lua | |
| parent | 9531ae2ef6c02640d2daa2608dd9665c1643a225 (diff) | |
| download | nvim-conf-26f078de81ee51f1fb91a5d4f5dc7837515ab8c0.tar.gz nvim-conf-26f078de81ee51f1fb91a5d4f5dc7837515ab8c0.zip | |
more updates
Diffstat (limited to 'lua/plugins/treesitter.lua')
| -rw-r--r-- | lua/plugins/treesitter.lua | 130 |
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, + }, + }, } |