nvim/lua/plugins/treesj.lua

21 lines
593 B
Lua
Raw Normal View History

2024-08-02 00:11:41 -07: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 00:06:49 -07:00
{ "<space>ts", "<cmd>TSJSplit<cr>", desc = "Treesitter Split" },
2024-08-02 00:11:41 -07:00
},
config = function()
2024-09-18 19:16:16 -07: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 00:11:41 -07:00
end,
}