Sublime Forum

Disable multiple selection

#1

Hi,

is there a way to disable multiple selection? I keep accidentally selecting more than one place and overwriting bits of my code without realising! It’s pretty annoying.

I’ve tried adding:
“multi_select”: false
to my user settings but it has not made any difference.
I’m using Sublime Text 2.0.2, Build 2221

thanks in advance,
Alex

0 Likes

How to disable multiple cursors in Sublime Text 2
#2

You are doing something wrong. Multiple Selections are a great Feature not a Bug.

mfg Tobias

0 Likes

#3

I didn’t say it was a bug, I just said that I wanted to know if it is possible to turn it off.
You may find it a great feature but it certainly doesn’t work for me!

0 Likes

#4

You can’t turn it off.

0 Likes

#5

What are you doing to create the multiple cursors? Ctrl/cmd+d? Ctrl+click? The best you could probably do is override a particular command so the additional selection doesn’t occur. This could prevent additional cursors from being placed for your normal circumstances.

0 Likes

#6

I’m accidentally Ctrl+Clicking. Normally it happens when I’ve used Ctrl+C to copy a variable name then click elsewhere that I want to paste it in, but do so too quickly and I haven’t quite released the Ctrl key.

So you say I could override the Ctrl+Click command somehow? Could you let me know what the procedure would be to do this?

thanks

0 Likes

#7

Sure, in your User directory, create a “Default ().sublime-mousemap”. Where is Windows, OSX, or Linux. Then add the following content.


    {
        "button": "button1", "count": 1, "modifiers": "ctrl"],
        "press_command": "drag_select",
    }
]
0 Likes

#8

thanks a lot, Ill give that a try!

0 Likes

#9

Just a couple more questions:

I’m on windows, so should my sublime mouse-map json file be called:

Default Windows.sublime-mousemap

with a space between ‘Default’ and ‘Windows’, and the ‘W’ capitalised?

And for the content, do I include the square brackets, ie putting the content into an Array?

Because that’s what I’ve done, putting the file into this folder:

C:\Users\alex.harrison\

which is my windows user directory, and it hasn’t worked.

0 Likes

#10

The best way of doing this is to go to preferences->key bindings user.
This way you are sure that things are saved correctly, where it should.

0 Likes

#11

Oh yeah, thanks - I added the data to my user key preferences file and on a basic quick check it seems that it might have worked now - thanks a lot for your help!

0 Likes

#12

Here is another tip: if you just want to select a variable name (or a word), you could just press ctrl+d once.

0 Likes

#13

Glad you got it working but I’m a bit confused. You said it was a mouse control that was causing issues, not a key binding. Well whatever, as long as it’s working there shouldn’t be any problems. For anyone else that comes across this though, I’ll answer your question anyways (with regards to mouse maps as they aren’t accessible through the menu).

The file goes in Packages/User. The exact location of this file will vary by OS.

OS X: ~/Library/Application Support/Sublime Text 2/Packages/
Windows: %APPDATA%/Roaming/Sublime Text 2/Packages/
Linux: ~/.config/sublime-text-2/Packages/

Replace 2 with 3 if you are on that version of ST. The file name will also be OS dependent.

OS X: Default (OSX).sublime-keymap
Windows: Default (Windows).sublime-keymap
Linux: Default (Linux).sublime-keymap

0 Likes