Is it possible to allow automatic line break PyCharm when writing long doksterii and comments?

Writing long docstrings and long comments is annoying due to a width limit of 80 characters.

For example, I write something like:

def fun(self): """Return some thing This function do some complex work and return something that need a long sentence to describe """ 

And then I found that I needed to insert something into the third line of the docstring. After insertion, the width is much longer than 80 characters, so I will manually break it. However, after breaking, the length of the fourth line is much less than 80, and I have to combine the fourth and fifth lines and split it in some proper place so that each line is not too short and too long. If there are more lines, this work becomes more annoying.

A similar problem occurs when I find that I need to delete something on the third line. Is there a trick or PyCharm plugin that deals with this issue? Since I use the vim plugin in PyCharm, the vim tricks are also great.

+6
source share
1 answer

Edit -> Fill Paragraph

Combines a paragraph, i.e. area of ​​text without an empty line between them.

If you want to leave the text alone, you will need an empty line between it and the text in which the focus is

+1
source

All Articles