How to deselect a single multi-selection point in Sublime Text 2
Asked Answered
V

5

15

I am finding I often will multi-select a bunch of single points (ctrl+click on the point) in Sublime Text 2, get to the end of the items I want to multi-select and then discover one in the middle of them all that should not have been selected.

I then have to cancel the multi-select (esc key) and start my selection all over.

Is there a way to deselect a single multi-select point? I looked all over the net and experimented with the traditional opposite items such as ctrl+shift+click on the point I want to deselect. No joy.

Thanks in advance for your help!

Vantassel answered 20/9, 2013 at 18:26 Comment(0)
I
21

Try this one:

alt + Middle Mouse Button

this feature/shortcut is called subtract from selection.

Ilyssa answered 20/9, 2013 at 19:5 Comment(2)
I just forgot to say that, on OS X (Mac), you should use Command+Shift instead of Alt.Monogamist
And what if I'm using the trackpad and have no middle mouse button?Beauteous
Z
12

In OSX +opt+shift+ left click removes an added multi-cursor.

Zilpah answered 13/1, 2015 at 16:11 Comment(1)
Just ⌘+shift + left click is enoughConal
R
5

On Linux, if you are using a touchpad, try using: Alt + Shift + Right-Click.

Resinous answered 25/5, 2018 at 20:2 Comment(1)
Thanks! This is the only one option working for me in Ubuntu :)Reichsmark
M
3

If you are on OSX, you need to disable drag_text.

Edit your user preferences, i.e. super + , and add this:

"drag_text": false

Otherwise, you can select just like before - ctrl + click (command + click), and to deselect an instance you use alt + click (command + shift + click).

Matthiew answered 20/9, 2013 at 19:12 Comment(3)
Upvote because this does work, but is not the best answer for my use as it also disables the ability to drag and drop sections of code. So if I want the convenience of alt+click to deselect a multi-selection point the trade off is no drag and drop. This is a good solution for someone who may not have a three-button mouse. But, as I do have one, the solution from Hugo Corra is the best answer. Thanks so much for your solution!Vantassel
Made my answer relevant to both OSX and Windows users.Matthiew
If you are saying that in windows you just alt + click to subtract from the selection without having to disable draft_text, just an FYI that does not work. alt+middle button click does work in Windows, but not just alt+click (i.e. traditional left button click)Vantassel
B
3

To deselect any text region (this way also deselects any included cursor point(s)):

On Windows

Alt+Shift+Right_Mouse_Button (Drag-Select what you need to deselect)

OR: Alt+Middle_Mouse_Button (Drag-Select what you need to deselect)

On OSX

Command+Shift+Option+Left_Mouse_Button (Drag-Select what you need to deselect)

OR: Command+Shift+Middle_Mouse_Button (Drag-Select what you need to deselect)

This works on SublimeText 2/3.

In case you want to deselect a single cursor point (not a region), you can do the same and drag-select any region that includes that cursor point. [Example: My Wor[Cursor]d. To deselect the cursor you can drag-select on: r[Cursor]d (or any region including the cursor) and it will automatically deselect the cursor point.]

Source: Column Selection

Bloat answered 10/11, 2016 at 14:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.