-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Making "x" extend selection #1638
Comments
I'm very confused by this suggestion. vx is not a line wise mode, at least not as that term is used in vim. vx would simply turn on select mode and then select the current line. After that, moving the cursor up and down does not select whole lines. Helix doesn't currently have a line wise select mode. If you want to select multiple lines, you would hit x repeatedly, or v, then move the cursor up or down to the desired line, then x. |
Okay sorry my bad, I misunderstood how vx worked. However I don't think it changes that much, I still think x should be vx, because there is no situation that I can think of where you wouldn't want extended select when you use x. |
I do this all the time. xd to delete a line, xy to copy it. Having this start select mode would be super annoying. |
I've read this issue yesterday, at first I think this gonna be annoying too but then I realized that delete/copy in select mode will auto go back to normal mode so there won't different any quick linewise action like xd, xy... |
Yes exactly! Either you want to do an operation (which leaves extended selection mode), or you want to move in which case you want extended select mode (otherwise there was no reason to hit x in the first place |
I think we are misunderstanding each other. This change would not have any affect on xd or xy. I explain more in my other reply to @NNBnh |
Oh I see, yeah, you're right, this wouldn't affect quick line operations. Still, I don't really understand the improvement it makes. If you want to select multiple whole lines, why bother pressing x at the beginning of the motion at all? Why not just hit v and start moving up or down to the line you want? What is the difference between vkkkx and vxkkkx? And also, I think if you really wanted this, you could make your own key binding for it. x = [ "select_mode", "extend_line" ] |
One small note, if one were to change it to multi line highlight you wouldn't have to do vxkkkx, you'd simply do xkkk, which is one less key and is more intuitive than vkkkx. Anyway it was my bad that this got confusing, since I mentioned multi line select in the beginning. However I just want x to behave as vx does currently. Because there is no situation in were x is preferable to vx. Now I would also like if X was multi line select, but that's an issue for another day. "And also, I think if you really wanted this, you could make your own key binding for it." I mean this argument can really be made for all keybindings. But if there is a keybinding that is better than another, why not make it the default? I even think this would be more intuitive, so I don't think that's a good argument either |
Ok, this
does not have anything to do with this
because there is no linewise select mode. That is not what vx is. Suppose you have the following text, and
Then you press vx, you end up with this
Then you press j, you end up with this:
To select both whole lines, you have to hit x again
Now let's start over
Press vj, you end up with this:
To select both whole lines, you have to hit x.
You get the same result as if you hadn't pressed vx. It seems like what you're asking for isn't a new key binding with the existing functionality; it seems like you're asking for a new linewise select mode feature. I wholeheartedly agree this would be an awesome feature. But it's a completely different request than changing a key binding. |
Once again I am sorry that I made this confusing. This has nothing to do with line wise select mode. I was only talking about line wise select mode because i misunderstood how vx worked. I dont want to implement line wise select mode (at least with this issue), I simply want x -> vx. So that if you want to select one line and a bit of the next line you can simply use x instead of vx. This isnt as useful as line wise select mode, but it does come up. And as I've said I think there is no downside and its more intuitive. So this change does not help if you want to select several entire rows, but it does help if you just want to select part of rows. |
I find the behaviour of x to be a bit weird. Why is it not like all the other movement keys. Like if you start with
And hit
And if you hit
But with
Then hit
Then hit
But I would expect, going of the other movement keys do to get
And then like the other movement keys if you want both lines selected you could do |
Yep! That's how |
There was some discussion of this on the Matrix recently, plus Kakoune recently changed |
That's the current Helix There should be a command that extends the selection to the full line but if the full line is already selected, instead of continuing to extend, selects the next line. |
Oh dear I should really read the keymap, |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
In the keymap discussion thread I wrote some suggestions of how to improve the keybindings of Helix #165 (comment)
Many of my proposed changes are subjective, however I think my suggestion of making x into line wise select mode doesn't have many downsides. By that I mean changing "x" into "vx".
The reason we need a visual mode at all is because the selection keys are also movement keys, which means you a way to determine if the user wants to extend the selection or simply move. But "x" isn't a movement key, so I cant think of a single use case where you would want to use "x", but also wouldn't want to extend selection. Either you use x to simply select the line for an operation like "d" or "y", in which case making "x" into extended selection doesn't matter. Or you want to select select multiple lines, in which case you need to use "vx". Also it doesnt really break consistency since "x" is a quite unique key already.
I might be wrong or missed something though, so I'd be happy to hear your thoughts
The text was updated successfully, but these errors were encountered: