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?
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" }
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With