Thanks for the tips about copying the relevant bits from the c-family.kak script! This seems to work perfectly.
However, it makes me wonder what other nice features might already be implemented for one language but not for others. It also makes me consider whether there might be a clean way of extracting a layer of “primitive” commands to more easily share such features across the filetype scripts. Small differences between languages may make this impractical, but it could be worth some thought…
While all the critical information has been stated by the previous posters, I think it may also be worth explicitly stating how to accomplish this for one new to Kakoune:
- Kakoune ships with extension scripts for filetype-specific functionality, which are by default installed to the
c-family.kak script to the
a. Copy over the c-family-insert-on-newline command definition, as seen here.
b. Copy the associated hook into the WinSetOption hook body, seen here.
There may be some details in the