Sublime Forum

Invert Selection!?

#1

When I search for invert selection for Sublime Text 2 in Google I find Sublime Text 2’s list of commands, one of which is invertSelection. When I create a keyboard shortcut for that command, it does not work. I’ve also tried invert_selection. What am I missing here?

Here’s my binding:

{ "keys": "ctrl+alt+i"], "command": "invertSelections"},

0 Likes

#2

Are you thinking about the reverse command?

I am not familiar with any invert command.

0 Likes

#3

It is listed here under invertSelection at this link:

http://www.sublimetext.com/docs/commands

Basically I want to be able to select a portion of the code, and hit a key, and then Sublime Text will deselect my current selection, and select everything that was not in my selection previously. Just like the command states…

0 Likes

#4

Those docs are out of date… I don’t know if Sublime Text 2 has an invert command. One would be really easy to write, though.

0 Likes

#5

That’s funny. It must have become deprecated. Someone should put a notice up that those may not be valid commands listed…

0 Likes

#6

Those commands are all from Sublime Text 1, which is why they don’t work.

0 Likes

#7

If only there was a similar commands list for ST2 :cry:

0 Likes

#8

I, too, wanted to find an “invert_selection” (and “clear_selection”) command and kept coming back to the ST1 command list. How can we be expected to create custom key bindings if there’s no list of available commands for ST2? Could someone point me at such a list?

0 Likes

#9

Jon added inverted selection to ST3. Get it while it’s hot :smile:

0 Likes

#10

I didn’t find a working solution so here is mine.

{ "keys": ["ctrl+i"], "command": "invert_selection"},

0 Likes