ziontee113/syntax-tree-surfer

Repetitions?

fsouza opened this issue · 9 comments

When swapping elements, it'd be cool to be able to support repetitions (so if I swap a block with the next one and want to continue moving it down I could just press .).

If this is reasonable, we could either integrate with vim-repeat or figure out repetition in some other way, let me know what you think!

Ah shoot. I don't know how to implement that atm.
Do you have any example / tutorial that I can follow? Ty :)

I also want to add "Jump to next sibling" in Normal Mode as well. If I have some simple example on how to . repreat then I will do them all at once.

I do not, sorry. I'd either integrate with vim-repeat or figure out how they do it.

I wonder you you're using swapping? Do you use syntax-tree-surfer to swap primarily in normal mode or in visual mode?

I wonder you you're using swapping? Do you use syntax-tree-surfer to swap primarily in normal mode or in visual mode?

I use swap in normal mode, but to be honest not as often. Just tried it in a file and realized that repetition would be really helpful.

One thing that would be great with swapping in normal mode is figuring out a better way to find the nodes that we want to swap. Maybe add support for custom queries or a filter closure.

Well, in normal mode, you can only swap things vertically right now. Can check the node you want to swap with <cmd>lua require("syntax-tree-surfer").select()<cr>, you'll get used to the normal mode swapping behavior.

I think the strongest feature of syntax-tree-surfer right now is in Visual Mode, where you can see what you selecting and swapping. I personally use and to swap elements in visual mode. So I didn't had a plan to do dot repeat functionality.

Well, in normal mode, you can only swap things vertically right now. Can check the node you want to swap with <cmd>lua require("syntax-tree-surfer").select()<cr>, you'll get used to the normal mode swapping behavior.

You can swap horizontally with require("syntax-tree-surfer").surf(direction, "normal", true).

What I want is not getting used to what gets swapped, but being able to customize it 😁 I find that using visual mode is inefficient and not repetition friendly (assuming repetition is available).

I'll try to think of a better idea and can send as a proposal if that's ok with you.

Yeah cool man! I'll probably rewrite the plugin when I'm getter at Computer Science :)
The current state of the .surf function is really not extendable. It's a lot of spagetti code in there.

Close this issue since now the User can use Dot Repeat :) @fsouza