Text wrapping Python docstrings

Yannick Gingras ygingras at ygingras.net
Wed Feb 2 15:06:43 GMT 2022


I got it to work exactly the way I want with the External Tools plugin.
This plugin makes is really easy to bind the script to a keyboard
shortcut. For reference, I'm attaching the quick and dirty script I use
to re-format the text.

On Tue, 2022-02-01 at 22:35 -0800, Yannick Gingras wrote:
> On Wed, 2022-02-02 at 11:11 +0500, Waqar Ahmed wrote:
> > I don't think there is an easy way atm, but maybe you can use the
> > "script" api to write a script that adjust the indent for you?
> 
> My javascript is not really good, but it would be really easy for me
> to
> do a Python command line and to pass the fragment to "filter through
> command". Is there a way I could bind that to a keyboard shortcut?
> Let's say rebind ALT-W to "filter throught re-fill.py" without
> opening
> the command prompt?
> 

-- 
Yannick Gingras
http://ygingras.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: refill.py
Type: text/x-python3
Size: 944 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20220202/6ab718ce/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: This is a digitally signed message part
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20220202/6ab718ce/attachment.sig>


More information about the KWrite-Devel mailing list