I frequently have a situation where I'll write a paragraph in a docstring for a function, then come back later and want to add to some part of the middle of the paragraph, and that will make me have to re-adjust the rest of the lines to have them be the proper length (not too long, not too short). This feels like something that should have an automation available for it.
I guess the trickiest part would be that the plugin would need to understand when to take words off of one line and add them to the beginning of the next line.
Is there some plugin or built-in action that will do this for me?
textwrap
module is great for doing exactly this kind of formatting.Hard wrap at
&Wrap on typing
). However, this setting is applied on everything (code included), not just docstring. Alternatively, you can select the docstring and format it usingEdit
->Fill paragraph
Edit
->Fill paragraph
does exactly what I was looking for. If you want to post it as an answer I'll accept/upvote it, otherwise I'm going to post the answer myself.