Text wrapping Python docstrings

rhkramer at gmail.com rhkramer at gmail.com
Mon Jan 31 19:48:51 GMT 2022


On Monday, January 31, 2022 12:05:33 AM Yannick Gingras wrote:
> Hi everyone,
> Is there an easy way to re-wrap paragraphs in Python docstrings to that
> they indent to match the current block? Of example, if I have:
> 
> def foo():
>     """ Foo is a really cool function.
> 
>     Something really long and verbose about foo() that I would type as
> one really long line until I feel ready to move to the next paragraph.
> 
>     """

I hesitate to suggest to anyone a different way of working, but I like 
"(View==>)Dynamic Word Wrap" (in my old version of Kate (3.8.4 for KDE 4.8.4 
on Debian Wheezy).  It doesn't solve the problem you raised -- keep reading. 

> If I hit ALT-W, the text will re-wrap nicely, but the second line will
> start at column 0. I would rather have it start at column 4 like this:
> 
> def foo():
>     """ Foo is a really cool function.
> 
>     Something really long and verbose about foo() that I would type 
>     as one really long line until I feel ready to move to the next
>     paragraph.
> 
>     """
> 
> If Kate does not support that directly, would an LSP pluggin be the
> easiest approach to add this?

Again, on my old version of Kate, under Settings ==> Configure-Kate ==> Editing 
==> Indentation, there is a setting to choose a Default indentation mode with 
quite a few choices -- I suspect on of those may do what you want, or come 
close. 






More information about the KWrite-Devel mailing list