2024-08-02 07:11:41 +00:00
|
|
|
return {
|
|
|
|
"Wansmer/treesj",
|
|
|
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
|
|
|
cmd = { "TSJToggle", "TSJJoin", "TSJSplit" },
|
|
|
|
keys = {
|
|
|
|
{ "J", "<cmd>TSJToggle<cr>", desc = "Toggle Treesitter Join" },
|
|
|
|
{ "<space>tj", "<cmd>TSJJoin<cr>", desc = "Treesitter Join" },
|
2024-08-22 07:06:49 +00:00
|
|
|
{ "<space>ts", "<cmd>TSJSplit<cr>", desc = "Treesitter Split" },
|
2024-08-02 07:11:41 +00:00
|
|
|
},
|
|
|
|
config = function()
|
2024-09-19 02:16:16 +00:00
|
|
|
require("treesj").setup({
|
|
|
|
use_default_keymaps = false,
|
|
|
|
on_error = function(err_text, level)
|
|
|
|
if not err_text:find("splitted") then
|
|
|
|
vim.cmd.join()
|
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
2024-08-02 07:11:41 +00:00
|
|
|
end,
|
|
|
|
}
|