Hey,
I have been using Kakoune for a few years already. But I came to realize recently that I did not do much of kakscript. I just adapted a few configurations that I found, and I kept my kakrc
very minimalist, trying to learn what the default experience could bring me. And this has been very valuable.
However, recently, I decided that I would like to take inspiration from the Plan9 Acme editor (which I really like) and bring them into Kakoune. Maybe not everything, but small bits that I could incorporate and that would turn my experience with Kakoune into a more personal story. But before doing that, I had to overcome something that I did not think would be much of a challenge: kakscript.
Effectively, even if I have dug many parts of Kakoune extensively, going so far as to read a lot of its internal source code, surprisingly, I never took much time writing kakscript. I mostly read what was inside the internal rc
(which is super valuable already). I am rather familiar with POSIX shell (if you are not, I recommend reading POSIX Shell Tutorial). But trying to write kakscript was a different story. I think this is a hard task for someone that starts doing it for the first time.
This is hard mostly because there is no material to learn it. You just read the docs, pick some bits from rc
and start adapting and writing yours. And you start hitting some walls. And I realized those walls were mostly related to the lack of understanding on how kakscript was parsed and evaluated. So a few weeks ago, I decided to stop the implementation of my kak plugin and start writing a blog post that would explain what I understood from learning the parsing and evaluation of kakscript.
I have been helped a lot by @alexherbo2 , so thank you a lot for the time you spent with me.
And now I would like to share my post here. I am aware that this can says things that may be wrong, and I would love to have feedback so that I can improve it. I haven’t seen any guide like that, so I really hope that it can help beginners to get up to speed rapidly. When those concepts are understood, kakscript becomes fun to write!
Have a good read and thank you in advance for any feedback that you can give me, including corrections, reorganisations or just your feelings about whether such a guide can be useful or not.
Here is the link below. Note that I don’t have a personal blog. I don’t write that much and I like the convenience of gist for my writing. The style might not be super pretty, but it is effective…
Thank you!