Yeah, I've found myself using Carbon for sharing code in my tweets, really it's the only time I use it.
1. Hit print screen on your keyboard
2. Select the rectangle area that you want to capture
3. Paste it into a tweet
You don't even need an intermediate image on your computer unless you wanted to crop it before sending it to Twitter.
You may also want to consider a step 0 which is to temporarily bump up the font size in your editor to make it more readable in a tweet.
This is what Windows 10 does when you hit print screen on its own (as of a recent'ish update).
Then there's also:
alt + print screen to automatically capture the focused window.
And ctrl + print screen to capture all monitors instead of the focused window.