Skip to content
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

Improved column selection (Alt+select) #5402

Open
glen-84 opened this issue Apr 16, 2016 · 189 comments
Open

Improved column selection (Alt+select) #5402

glen-84 opened this issue Apr 16, 2016 · 189 comments
Labels
editor-columnselect Editor column selection issues feature-request Request for new features or functionality
Milestone

Comments

@glen-84
Copy link

glen-84 commented Apr 16, 2016

The column selection implemented in #1515 is a start, but it's a bit awkward and unintuitive compared to other editors.

With the following editors or IDEs, you can create a column selection starting from where the mouse is clicked/dragged:

  • Atom (with Sublime Style Column Selection)
  • Eclipse
  • Notepad++
  • Programmer's Notepad
  • Sublime
  • Visual Studio 2015

At least Eclipse, Programmer's Notepad, and VS2015 support virtual whitespace as well, creating a complete square/rectangle.

Some of them also don't show multiple cursors, which I think looks better.

Other users were also expecting this behaviour (see here and here).

@dvlsg
Copy link

dvlsg commented Apr 16, 2016

You can knock the assumed off sublime, I can confirm it works that way. The shortcut isn't alt-click for me on windows, but the selection does start where you click.

@IntelOrca
Copy link

This is our target behaviour, and hopefully possible when virtual space is supported.

vs

@dvlsg
Copy link

dvlsg commented Apr 19, 2016

Looks good to me, I think.

Is there any hope of support for multi-cursors that aren't necessarily next to each other?

For a contrived example, say I have JSON with integer values, but they really should be doubles. With multi-cursors, I can accomplish that fairly easily. Will this be possible with the proposed block column selection?
multi-cursor-select

@alexdima
Copy link
Member

alexdima commented Apr 28, 2016

Today, the column selection is piggy-backed onto the multi-cursor support (i.e. it is logically represented and consists of multiple cursors). This makes it indeed behave differently than Visual Studio, for example.

That being said, with the exception of empty lines (virtual whitespace) we are not that far:

column-select

@dvlsg We have multi-cursors since v0.1.0. Please see https://code.visualstudio.com/docs/editor/editingevolved#_selection-multicursor

@alexdima alexdima added the feature-request Request for new features or functionality label Apr 28, 2016
@dvlsg
Copy link

dvlsg commented Apr 28, 2016

Oh awesome! My apologies for missing it in the release notes -- thanks for taking the time to add the link, I appreciate it.

@nholthaus
Copy link
Contributor

#11830 may provide a more clear description of the expected behavior.

@IntelOrca
Copy link

IntelOrca commented Sep 11, 2016

@nholthaus unfortunately I don't think this can be implemented until virtual space is implemented - that should probably be a feature request of its own.

@alexdima
Copy link
Member

@nholthaus From #11830

Most programs with column mode (visual studio/notepad++/kdevelop/etc) have the following user experience:

  1. hold the keyboard shortcut/toggle column mode.
  2. click somewhere. This is the selection 'start' anchor.
  3. drag somewhere. This is the selection 'end' anchor.

This is not how Visual Studio 2015 behaves for me:

  • I click somewhere
  • I press and hold shift + alt
  • I click and drag somewhere else
  • the anchor is the location before pressing shift + alt
    shift-alt-vs

@nholthaus
Copy link
Contributor

@alexandrudima yeah but visual studio also has an alt button column mode that does what I described, which is the only one I'd ever use. Visual studio code doesn't seem to have the equivalent, or if it does it doesn't work on linux.

@alexdima
Copy link
Member

Oh, ok, we only added the shift+alt+ behaviour. IMHO we first need to make the mouse gestures configurable as alt+ clicking is occupied by adding a new cursor (a feature VS does not have) and then we can allow customizations of the modifiers + clicking and add this other way of column selection

@alexdima alexdima added editor-core Editor basic functionality editor editor-multicursor Editor multiple cursor issues labels Sep 12, 2016
@alexdima alexdima added this to the Backlog milestone Sep 12, 2016
@nholthaus
Copy link
Contributor

Cool. I'm not concerned at all if the shortcuts don't match, as long as the functionality could be accessible somehow.

@nholthaus
Copy link
Contributor

@alexandrudima Also (on Kubuntu) alt+click moves the window, it doesn't add a cursor. Does that sound like I should file a bug report?

@alexdima
Copy link
Member

We have had the report multiple times. It boils down to supporting customization of mouse shortcuts (#3130)

@IntelOrca
Copy link

@alexandrudima do you intend to implement virtual space in the furture... e.g. hold alt and click somewhere where there aren't any characters yet still have a caret there? Typing then inserts the spaces up the caret automatically.

@smuuf
Copy link

smuuf commented Sep 29, 2016

  1. Is there any specific reason why multi-cursor placing is mapped to ALT button instead of Sublime-like CTRL? I have a history with Sublime (as opposed to, eg., Visual Studio) and CTRL is more natural to me (I know me is not an argument, but ...). Is this something that could be configurable? I don't see it in keybindings config. 😞 ... If ALT is something only Code does, then I would definitely vote for the quickest possible change to CTRL-behaviour, so there are as few people as possible who would have to re-adapt.
  2. Is there any specific reason why block-selection mode is made with SHIFT+ALT+LEFT-MOUSE-CLICK fingerbreaker instead of just MIDDLE-MOUSE-BUTTON? Just why? Give us the MIDDLE-MOUSE-BUTTON :) Or give us a configurable keybindings for this. (I, sadly, don't see any for this.)

I don't mean to nag :) ... I just wonder these questions every time I work with multiple cursors and block selections in Code. Having these features behaving like in Sublime (from which migrated to Code, mainly because of the debugging tools) would be such a workflow-booster! ❤️

@jminer
Copy link

jminer commented Sep 30, 2016

Editors that could be added to the list are jEdit (it uses ctrl instead of the much more standard alt, but otherwise works the same as the other listed editors), Qt Creator, and IAR Embedded Workbench.

I think column selection should definitely use alt+click because it is the standard shortcut, and placing multiple cursors should use something else.

@Fania
Copy link

Fania commented Nov 10, 2016

I'm piggy-backing this issue as I think it fits here.
I'd like to add that it would be nice to have column select respect (i.e. ignore) the wrapping of long lines of text.
I encounter this all the time in Latex - writing out a list of sentences and wanting to add the "\item" command in front of all of them but it messes up lines that wrap across the page.
And no, I wouldn't want to disable line-wrapping every time I want to use column select.
Does that make sense?
columnwrap

@rjmunro
Copy link

rjmunro commented Jan 9, 2017

It would be good if I could alt-drag without shift.

In general, a drag means select and alt drag means select rectangle. alt-drag works in many other places including away from coding editors, e.g. MS Word & the default Mac OS terminal.

Shift-click means create a selection from the current cursor location to the mouse position. Subsequently dragging it can be used to make adjustments.

The two are separate things that can be used together, or one at a time. Shift-alt-click should start the rectangular selection from the current cursor position, which it does. Alt-drag with no shift should start a new selection from the initial click of the drag.

@velociwabbit
Copy link

velociwabbit commented May 31, 2022 via email

@sirdeniel
Copy link

@velociwabbit My bad, I didn't read all the context. I will be more careful next time, sorry. My only intention now is to point the shortcut.

@gingerbeardman
Copy link

That shortcut you mention is not the feature that is being requested. What you're suggesting is linked in th OP as #1515 but it's incomplete and lacking.

@robertjpayne
Copy link

I think there's two issues being bundled here:

  1. Requires virtual space and allows "overselection" where you can just straight up box select"
  2. Is already implemented with "middle mouse button" where you can do a multi-line select starting from the mouse.

All I want is a match in Sublime and many many other editors where alt+click and drag starts a multi-line select from the cursor. Basically can we please keybind what the middle mouse down selection is already doing?

@velociwabbit
Copy link

velociwabbit commented Aug 20, 2022

I am frankly stunned that this issue has not been addressed.

The general consensus among experienced developers is that the vscode editor compared to visual studio is a toy. This is one single issue that one can point to to show how half baked the product is.

The ONLY rationale for not fixing this is that it would accelerate the movement from visual studio and its high corporate cost and therefore revenue towards this newer dev editor (vscode) .

@Felice-Enellen
Copy link

  1. Is already implemented with "middle mouse button" where you can do a multi-line select starting from the mouse.

Pretty sure that's also using multiple cursors to simulate rectangular selection. It's not really rectangular selection, just a quick way to set up a bunch of cursors, each with their own selection attached.

@arjan-saly-tfs
Copy link

We're very close to 6 years (!!) since this feature was requested. Many other editing solutions support virtual/implicit spaces for column selection. Even SQL Server Management Studio (SSMS), which is primary targeted for database management and also support database development supports this for many years. SSMS doesn't even come close to VSCode capabilities with respect to powerful code editing.

I'm a database & SQL specialist, not a a developer, but cooking at the capabilities of vscode like multi-select/edit, how can it be that vscode developers are not capable to add virtual spaces?

What does it take to get vscode developers to finally adopt this suggestion and implement it?

Until this is implemented, has anybody found an extension that adds this feature?

@merrillaldrich
Copy link

I'm also still waiting for this - thanks for keeping hope alive! I think Visual Studio 2022 has it, in addition to Visual Studio 2015 (!) as noted above.

@mxmlnkn
Copy link

mxmlnkn commented Apr 7, 2023

I'm gonna unsubscribe from this issue. I don't see it happening anytime soon. And after using vscode sporadically, my two other main gripes with it are the memory bloat for something as simple as a text editor. Because of that, other stuff gets OOM-killed, especially during parallel compilation. The other gripe is the lack of responsiveness for simple stuff like scrolling or moving the cursor, especially for things like larger syntax-highlighted markdown files. I'm happy with SciTE + the command line. Maybe I'll even migrate to vim in the next decade, who knows.

@gingerbeardman
Copy link

Yeah, I'm out too. Life's too short. Deleted VScode.

@velociwabbit
Copy link

velociwabbit commented Apr 7, 2023 via email

@Felice-Enellen
Copy link

I agree. VSCode feels more and more like it's written by a bunch of glue-logic "coders" who are committed to feature creep over quality and basic functionality. The electron/cef bloat is ridiculous and the functionality is substandard and implemented with sledgehammers. I'm tired of waiting for simple stuff like this to be done while I see more and more bloat being added with every release. If I wanted to use a js-encrusted browser window to edit code, I'd buy a Chromebook, not a PC.

Time to find something else.

@m6502
Copy link

m6502 commented Apr 8, 2023

I'm also still waiting for this - thanks for keeping hope alive! I think Visual Studio 2022 has it, in addition to Visual Studio 2015 (!) as noted above.

Of course they have it. This is not an "advanced" or "modern" feature. The "real" Visual Studio had it already in the 1990s. I repeat. DECADES ago. Virtual Space has always been an obvious standard out-of-the-box feature that any editor had, that has been lost to the sands of time only because a series of unfortunate coincidences about what was favored by the fads of the moment.

@velociwabbit
Copy link

velociwabbit commented Apr 9, 2023 via email

@chaoticbob
Copy link

Anyone else still waiting for Alt + select?

@Clonkex
Copy link

Clonkex commented Sep 20, 2023

I find it utterly baffling that it's been OVER 7 YEARS since this was requested and it's still ignored. Not only that, but the keyboard shortcuts make no sense at all. Check out this insane behaviour:

editor.multiCursorModifier = alt:
- Ctrl+drag: regular select
- Alt+drag: regular select
- Ctrl+click: go to definition
- Alt+click: create multiple cursors

editor.multiCursorModifier = ctrlCmd:
- Ctrl+drag: regular select
- Alt+drag: block/column select
- Ctrl+click: create multiple cursors
- Alt+click: go to definition

??? This proves that modifier+drag select is fully possible and supported. They clearly took the keyboard shortcuts, multi-cursor mode setting and functionality and just threw dice to decide how they should be connected. Not only does modifier+drag select functionality disappear entirely if you use the default alt setting, but if you use the ctrlCmd setting, the function to create multiple cursors is on a different key to modifier+drag select functionality! Who does that??

@jgwinner
Copy link

Good grief. I just tried to see what box select was for the Mac and stumbled here. What a mess. For the record, I use both Mac and PC.

Subscribing.

@chaoticbob
Copy link

I find it utterly baffling that it's been OVER 7 YEARS since this was requested and it's still ignored. Not only that, but the keyboard shortcuts make no sense at all. Check out this insane behaviour:

editor.multiCursorModifier = alt:
- Ctrl+drag: regular select
- Alt+drag: regular select
- Ctrl+click: go to definition
- Alt+click: create multiple cursors

editor.multiCursorModifier = ctrlCmd:
- Ctrl+drag: regular select
- Alt+drag: block/column select
- Ctrl+click: create multiple cursors
- Alt+click: go to definition

??? This proves that modifier+drag select is fully possible and supported. They clearly took the keyboard shortcuts, multi-cursor mode setting and functionality and just threw dice to decide how they should be connected. Not only does modifier+drag select functionality disappear entirely if you use the default alt setting, but if you use the ctrlCmd setting, the function to create multiple cursors is on a different key to modifier+drag select functionality! Who does that??

If it wasn't for the HLSL highlighter, I would've bailed.

@velociwabbit
Copy link

velociwabbit commented Oct 14, 2023 via email

@Felice-Enellen
Copy link

Felice-Enellen commented Nov 13, 2023

Because of this insanity and the overall lack of precision of the vs code
editor I have reverted back to visual studio.

I feel much the same. This project is doomed to eternal glue-logic and feature creep with very little apparent skill or care. The amount of memory it uses just to be a text editor is atrocious, never mind the lack of movement on basic universal needs while the strangest, most niche platform compatibilities are added ad nauseum has made my mind up for me. I'd never used Sublime before, but now I've tried it and it is absolutely the minimalist editor I want. I don't need an IDE capable of tracking my every thought and integrating with a hundred different languages. I just need a decent code editor. I'm out, goodbye VSCode, it seriously hasn't been nice to know ya.

I recommend someone on the steering team for this project open their eyes to just how horribly bloated and misdirected it is. Recruit some senior software engineers, and I do mean literally senior, and ask them what's wrong with it, and do what they tell you to do, e.g. make it 10x more modular so it's not taking up gigs of memory, focus on getting the actual TEXT EDITING solid and complete, etc.

Edit: You know, it occurs to me that any truly senior dev is going to abandon this editor in due time, meaning that the only people left using it will be the ones who don't know any better and won't complain about the things they don't know could be better. That's kind of sad for them.

@velociwabbit
Copy link

velociwabbit commented Nov 13, 2023 via email

@mister-good-deal
Copy link

mister-good-deal commented Feb 29, 2024

02/29/2024, still not possible to bind mouse wheel click to @command:workbench.action.toggleMultiCursorModifier

editor.multiCursorModifier =

And so cannot select multi lines with my mouse only like in JetBrains IDE :sigh:

@rainbowjose
Copy link

Still waiting

@TurkeyMan
Copy link

Why is virtual-whitespace still pending? We've been waiting over a decade now!
Rectangle selection doesn't work without virtual whitespace... it's practically unusable; you encounter a line gap and end up with a random cursor at the start of the line where all the others are lined up vertically as they should be.

This is the only reason I don't use VSCode, but the pressure to move to VSCode is constantly increasing as VS-proper continues to lose relevance...

Please can someone actually comment on why this is still pending, and if it's ever coming?

@Felice-Enellen
Copy link

FYI for other people subbed to this issue, there is work being done on virtual space:

Mentioned at the (current) tail end of #13960, in this comment by the change's author, @x17jiri. See the comment for details on the fork where it's being worked on and possibly doing testing for them.

@connor4312 connor4312 marked this as a duplicate of #236213 Dec 19, 2024
@connor4312 connor4312 marked this as a duplicate of #188727 Dec 19, 2024
@connor4312 connor4312 marked this as a duplicate of #183392 Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-columnselect Editor column selection issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests