diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-24 20:35:27 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-01-24 20:35:27 +0900 |
| commit | c80a54e42b52ce297f0f2f71af23c562832025c7 (patch) | |
| tree | dcce8bb977a770f473325d48f6f70b21d9818a40 /ar/.config/LazyVim/lua/plugins/treesj.lua | |
init
Diffstat (limited to 'ar/.config/LazyVim/lua/plugins/treesj.lua')
| -rw-r--r-- | ar/.config/LazyVim/lua/plugins/treesj.lua | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/ar/.config/LazyVim/lua/plugins/treesj.lua b/ar/.config/LazyVim/lua/plugins/treesj.lua new file mode 100644 index 0000000..9cfb3ff --- /dev/null +++ b/ar/.config/LazyVim/lua/plugins/treesj.lua @@ -0,0 +1,32 @@ +return { + "Wansmer/treesj", + dependencies = { "nvim-treesitter/nvim-treesitter" }, + config = function() + require("treesj").setup({ + ---@type boolean Use default keymaps (<space>m - toggle, <space>j - join, <space>s - split) + use_default_keymaps = false, + ---@type boolean Node with syntax error will not be formatted + check_syntax_error = true, + ---If line after join will be longer than max value, + ---@type number If line after join will be longer than max value, node will not be formatted + max_join_length = 300, + ---Cursor behavior: + ---hold - cursor follows the node/place on which it was called + ---start - cursor jumps to the first symbol of the node being formatted + ---end - cursor jumps to the last symbol of the node being formatted + ---@type 'hold'|'start'|'end' + cursor_behavior = "hold", + ---@type boolean Notify about possible problems or not + notify = true, + ---@type boolean Use `dot` for repeat action + dot_repeat = true, + ---@type nil|function Callback for treesj error handler. func (err_text, level, ...other_text) + on_error = nil, + ---@type table Presets for languages + -- langs = {}, -- See the default presets in lua/treesj/langs + }) + end, + keys = { + { "<leader>j", "<cmd>TSJToggle<cr>", desc = "Toggle Treesj" }, + }, +} |
