From 2e2010c48d53107636dc3581972df583bd5dfbc0 Mon Sep 17 00:00:00 2001 From: Christopher Williams Date: Sun, 11 Jan 2026 21:52:28 -0500 Subject: [PATCH] Split treesitter plugins --- init.lua | 1 + lazy-lock.json | 3 +- lua/plugins/ai.lua | 28 +++++++-------- lua/plugins/editor.lua | 34 +----------------- lua/plugins/treesitter.lua | 71 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 89 insertions(+), 48 deletions(-) create mode 100644 lua/plugins/treesitter.lua diff --git a/init.lua b/init.lua index 5a146a5..d984e66 100644 --- a/init.lua +++ b/init.lua @@ -37,6 +37,7 @@ require("lazy").setup({ require("plugins.ai"), require("plugins.orgmode"), require("plugins.lsp"), + require("plugins.treesitter"), }) -- LSP diff --git a/lazy-lock.json b/lazy-lock.json index dc53906..9bd7afa 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -30,9 +30,10 @@ "orgmode": { "branch": "master", "commit": "4da28a06d7a8b2563f1308c4550604f36e3c299f" }, "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, "promise-async": { "branch": "main", "commit": "119e8961014c9bfaf1487bf3c2a393d254f337e2" }, + "rainbow-delimiters.nvim": { "branch": "master", "commit": "d6b802552cbe7d643a3b6b31f419c248d1f1e220" }, "snacks.nvim": { "branch": "main", "commit": "fe7cfe9800a182274d0f868a74b7263b8c0c020b" }, - "swenv.nvim": { "branch": "main", "commit": "4157de2619ec2e5c61c103fb6517845a0e04e558" }, "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" }, + "treesj": { "branch": "main", "commit": "186084dee5e9c8eec40f6e39481c723dd567cb05" }, "vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" }, "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } } diff --git a/lua/plugins/ai.lua b/lua/plugins/ai.lua index c36e684..61f0c44 100644 --- a/lua/plugins/ai.lua +++ b/lua/plugins/ai.lua @@ -36,19 +36,19 @@ local M = { help = true, }, }) - vim.api.nvim_create_autocmd("User", { - pattern = "BlinkCmpMenuOpen", - callback = function() - vim.b.copilot_suggestion_hidden = true - end, - }) - - vim.api.nvim_create_autocmd("User", { - pattern = "BlinkCmpMenuClose", - callback = function() - vim.b.copilot_suggestion_hidden = false - end, - }) + -- vim.api.nvim_create_autocmd("User", { + -- pattern = "BlinkCmpMenuOpen", + -- callback = function() + -- vim.b.copilot_suggestion_hidden = true + -- end, + -- }) + -- + -- vim.api.nvim_create_autocmd("User", { + -- pattern = "BlinkCmpMenuClose", + -- callback = function() + -- vim.b.copilot_suggestion_hidden = false + -- end, + -- }) end, }, { @@ -61,4 +61,4 @@ local M = { }, } -return M \ No newline at end of file +return M diff --git a/lua/plugins/editor.lua b/lua/plugins/editor.lua index cd49fe8..192dfb9 100644 --- a/lua/plugins/editor.lua +++ b/lua/plugins/editor.lua @@ -17,39 +17,7 @@ local M = { }, }, }, - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - config = function() - local ensureInstalled = { - "lua", - "python", - "javascript", - "typescript", - "java", - "go", - "rust", - "html", - "css", - "json", - "yaml", - "markdown", - "sql", - "org", - } - local alreadyInstalled = require("nvim-treesitter.config").get_installed() - local parsersToInstall = vim.iter(ensureInstalled) - :filter(function(parser) - return not vim.tbl_contains(alreadyInstalled, parser) - end) - :totable() - require("nvim-treesitter").install(parsersToInstall) - end, - }, - { - "nvim-treesitter/nvim-treesitter-textobjects", - branch = "main", - }, + { "junegunn/fzf.vim", dependencies = { diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..e9c54a8 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,71 @@ +local M = { + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + config = function() + local ensureInstalled = { + "lua", + "python", + "javascript", + "typescript", + "java", + "go", + "rust", + "html", + "css", + "json", + "yaml", + "markdown", + "sql", + "org", + } + local alreadyInstalled = require("nvim-treesitter.config").get_installed() + local parsersToInstall = vim.iter(ensureInstalled) + :filter(function(parser) + return not vim.tbl_contains(alreadyInstalled, parser) + end) + :totable() + require("nvim-treesitter").install(parsersToInstall) + end, + }, + { + "nvim-treesitter/nvim-treesitter-textobjects", + event = "VeryLazy", + branch = "main", + }, + { + "HiPhish/rainbow-delimiters.nvim", + event = "VeryLazy", + }, + { + "Wansmer/treesj", + event = "VeryLazy", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + opts = { use_default_keymaps = false }, -- optional, if you don't want m/j/s at all + keys = { + { + "ga", + function() + require("treesj").toggle() + end, + desc = "TreeSJ: toggle", + }, + { + "gs", + function() + require("treesj").split() + end, + desc = "TreeSJ: split", + }, + { + "gS", + function() + require("treesj").join() + end, + desc = "TreeSJ: join", + }, + }, + }, +} + +return M