If you're using Sublime Text, [Wrap Plus](https://sublime.wbond.net/packages/Wrap%20Plus) is great for doing this automatically.