Suppose you want to get from something like this:
if ( cond ) {
doSomething();
} else {
goSomewhere();
doSomethingElse();
comeBack();
takeANap();
}
To this:
if ( cond ) {
doSomething();
}
goSomewhere();
doSomethingElse();
comeBack();
takeANap();
1. First, put your cursor on "else" and press Ctrl+Shift+Right to select it.
2. Press Enter.
3. Press Ctrl+Delete, and select Unsurround the code block.
Though Unsurround does not normally apply to "else" blocks, this example shows how you can manipulate your code to make a feature work for you in order to save time.