Splitjoin parents #130
Replies: 1 comment 4 replies
-
You can specify require('treesj').setup({
langs = {
lua = {
arguments = {
both = {
enable = false,
},
},
},
},
})
There are no plans to add functionality for highlighting all nodes. In neovim there are many possibilities to move to the desired location (including treesitter based plugins). I don't think it's right to duplicate such functionality in |
Beta Was this translation helpful? Give feedback.
-
Asking as a discussion in case i've missed this being an existing feature (i have a feeling i misunderstood or dont use recursive preset properly)
Below is the same line of code with two different cursor positions
Doing
treesj.toggle()
in each of those cases has different behaviour, the first splits the argument list, the second splits the function into 3 lines:Is there a way to get the behaviour of the second case when the cursor is in the position of the first case? The closest i have found is
vif
(using treesitter textobjects) then usetreesj.toggle()
, this is basically equivalent to jumping to the beginning of the function.In general a way to split/join the parents of deeply nested structures would be nice.
If it doesn't exist then how could it be implement? I think you could use
vim.v.count1
. Alternatively if an API was given that searched for all the possible splitjoin nodes then we could integrate with flash.nvim to use labels to choose which node to splitjoin.Beta Was this translation helpful? Give feedback.
All reactions