summaryrefslogtreecommitdiff
path: root/config/nvim/lua/plugins/treesitter.lua
diff options
context:
space:
mode:
author2025-06-09 13:43:45 +0300
committer2025-06-09 13:55:38 +0300
commit97af93b2a8ebc89364852e3f63e9fd8cfedaeedf (patch)
tree27e2added74ee6c0ff91c9e7927491c661a8bb36 /config/nvim/lua/plugins/treesitter.lua
parent04.06.2025 (diff)
downloaddotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.gz
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.bz2
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.tar.xz
dotfiles-97af93b2a8ebc89364852e3f63e9fd8cfedaeedf.zip
Перевёл dotfiles на stow
Diffstat (limited to 'config/nvim/lua/plugins/treesitter.lua')
-rw-r--r--config/nvim/lua/plugins/treesitter.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/config/nvim/lua/plugins/treesitter.lua b/config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..59e9294
--- /dev/null
+++ b/config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,53 @@
+return {
+ "nvim-treesitter/nvim-treesitter",
+ build = ":TSUpdate",
+ opts = {
+ highlight = {
+ enable = true,
+ additional_vim_regex_highlighting = false,
+ },
+ ensure_installed = "all",
+ ignore_install = { "gdhsader", "phpdoc", "org" },
+ indent = { enable = true },
+ auto_install = true,
+ sync_install = true,
+ incremental_selection = {
+ enable = true,
+ keymaps = {
+ init_selection = "<C-space>",
+ node_incremental = "<C-space>",
+ scope_incremental = false,
+ node_decremental = "<bs>",
+ },
+ },
+ textobjects = {
+ select = { enable = true, lookahead = true },
+ move = {
+ enable = true,
+ goto_next_start = { ["]f"] = "@function.outer", ["]c"] = "@class.outer", ["]a"] = "@parameter.inner" },
+ goto_next_end = { ["]F"] = "@function.outer", ["]C"] = "@class.outer", ["]A"] = "@parameter.inner" },
+ goto_previous_start = {
+ ["[f"] = "@function.outer",
+ ["[c"] = "@class.outer",
+ ["[a"] = "@parameter.inner",
+ },
+ goto_previous_end = { ["[F"] = "@function.outer", ["[C"] = "@class.outer", ["[A"] = "@parameter.inner" },
+ },
+ },
+ },
+ build = function()
+ require("nvim-treesitter.install").update({ with_sync = true })()
+ end,
+ dependencies = {
+ { "nvim-treesitter/nvim-treesitter-textobjects" },
+ {
+ "nvim-treesitter/nvim-treesitter-context",
+ opts = {
+ enable = true,
+ mode = "topline",
+ line_numbers = true,
+ },
+ },
+ { "windwp/nvim-ts-autotag" },
+ },
+}