Closed sei40kr closed 1 year ago
Iron has support for iron_send_motion
.
You can just create your own text objects like this TSNode
and then make it an operator mode mapping like this vim.keymap.set('o', "aT", function() your_ts_node_implementation() end)
, then use iron_send_motion
(say defined as <Leader>s
) to send the text to the REPL (<Leader>saT
).
This is the universal way of how vim handles text: decouples the commands and the range of the text it operates on.
Thanks @milanglacier for stepping up to answer. It pretty much aligns with my point of view. Treesitter is a fantastic tool, but there's no need to couple it to iron more that what is done and supported already, through regular vim text objects.
Having that said, I'm closing the issue, but don't hesitate to open issues or start discussions if you have questions or ideas.
Best regards, Henry
I want a function that automatically select a valid Treesitter node from cursor position and send its contents to REPL.
Actually I already wrote this on my own:
Code