"Copy selection on <object>" motion #2784
Replies: 2 comments 4 replies
-
I'm not sure this is a good idea but I think you could approach this with the jumplist as well. Say we had a command that acted like |
Beta Was this translation helpful? Give feedback.
-
In kakoune, there are keybinds for combining marks, which are really just saved selections. We don't have marks yet, but its implementation could address your need as well. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In #1999, it was discussed how tree-sitter motions do not respect extend mode. The issue also brought up the desire to be able to copy selection on tree sitter objects (like
C
does for copy selection on next line). For instance, the user may want to copy the selection (create a new cursor) on the next argument:I think there are different alternatives to solve this kind of movement:
v
, copies the new selections. If this mode wasV
in the example above, it would beV]a
to select the next argument.duplicate cursor
+select only new cursor
+]amia
to reproduce the example.copy selection on <object>
, which can be used while being in other modes. This would require the same keystrokes as (1) ifV
is assigned to this motion.I prefer (3) over (1)
I believe that a motion makes the most sense because it can be used in other modes. This allows for chains like
vV]f
that would not only extend the selection to the next function (v]f
) but also select that entire function in the process. Note that neither of those behaviors are covered by extend mode at the moment. I think this kind of composition feels very natural.The case against (2)
Being able to control just one cursor is nice (#943) but it creates an extra complexity that "copy selection on next/prev arg/function/whatever" should not require in my opinion (although it may be great for other cases). Of course, this only matters if the users actually find themselves trying to do something like in the example..
The case against (3)
It feels like a verb + object action, which is not what helix tries to do.
Beta Was this translation helpful? Give feedback.
All reactions