Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to do Invert Selection in Sublime text 4?

In previous version (ST3) of Sublime Text, there was invert selection in Selection menu. With which you could simple select the text you desired to keep, invert the selection and delete.

Seems it's removed in current version. How to perform same action?

like image 917
Nijat Aliyev Avatar asked Jan 25 '23 07:01

Nijat Aliyev


1 Answers

while Selection > invert selection menu was removed in ST4, it is still available through command invert_selection. So one can use it by binding that command to some key combination. Here is my setup:

I used ctrl+i and ctrl+s multiple combination keys, which actually easier to remember. (invert selection)so if you use windows, go to Key Bindings by pressing ctrl+shift+P and then type Key Bindings. You will have your key bindings window open in new sublime text window, to the pane that's on right hand side (User defined key bindings) you can insert following: Make sure you insert it inside parent curly braces

{
    {..some other key bindings..},
    { "keys": ["ctrl+i", "ctrl+s"], "command": "invert_selection" }
}
like image 100
Nijat Aliyev Avatar answered Mar 25 '23 09:03

Nijat Aliyev