I’ve often been working on something that’s made me think, “it would probably be easy to write a plugin to streamline this.”
But 9 times out of 10 (or more like 99 out of 100), I’m not going to: start a new script, source it in my kakrc, restart Kakoune, go back to the original context from which I had the idea, test out the new script, find a problem…
In order to circumvent the pain of the above workflow, I put together this plugin to make prototyping plugins easier:
- Idea Appears in Brain
<space>qe(open the Quick-Dev Scratchpad)
- Bust out some rough kakscript to minimally test the idea.
<space>qr(re-load the scratchpad code)
ga(go back to original context)
- Test it out.
- Repeat 2-6 while making small, incremental changes until it works how I want.
- Extract the code into a new plugin (eventually, when I get around to it).
The core idea is to use a little discipline to write kakscript that’s reloadable, then simply (re)source it. Additionally, the provided scratchpad file can be opened at a keystroke, and includes example kakscript to get started without having to reference 5
:doc pages to remember how to do the thing.
This is a little rough around the edges, but I’ve found it extremely useful myself, so I thought I’d share it.
Spin-offs or suggestions are welcome.