If I move the cursor to somewhere in the middle of a line of code, and I press the ENTER key, the text on the right is moved to the next line and it gets automatically indented.
But sometimes I want to do the opposite, to join two lines, but without the indentation of the second line. So, first I need to move the cursor to the beginning of the second line, just after the indentation, then erase all the spaces/tabs until I reach the first line.
Is there any keyboard shortcut or extension to achieve this?
Yes, there is. It's name is "Join Lines". To use it simply put the cursor on the above line, then press ctrl+shift+p (or click View -> Command Palette) and write "join" and select Join Lines command from the options:
If you like a keyboard shorcut to this command press again ctrl+shift+p and write "open", then select Preferences: Open Keyboard Shortcuts, search for Join Lines and add your desired key combination:
Hope it's useful for you.
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