When creating Kakoune plugins, I frequently felt guilty starting an entire process using %sh{}
to accomplish a task as simple as multiplying two numbers. This is what inspired me to create pykak, a plugin that allows plugin authors to script Kakoune with Python. The implementation relies on IPC instead of %sh{}
(besides the initial call to start the pykak server).
Here’s an example that sorts selections:
def sort-sels %{ python %{
sels = sorted(valq('selections'))
keval('reg dquote %s; exec R' % quote(sels))
}}
And here’s an example plugin: GitHub - tomKPZ/counted.kak: Alternative key counts for Kakoune
Please give it a try and let me know what you think. I’d love to get some feedback!