I know how to delete a single buffer. Or to repeat the command manually do delete multiple buffers. Or to exit Kakoune and enter again. But, is there a way to delete all buffers with a single command? Or is there a way to implement that easily with configuration?
The delete-buffer command only deletes a single buffer (the current buffer, by default).
evaluate-commands will run a command you give it, but if you use the -buffer NAME switch it will run the command the buffer named NAME, not in the current context. If you use the special name *, it will run the command in every open buffer.
So, the following command will delete every (unmodified) buffer:
Just to mention that I really like the buffer switcher plugin, which I thin you can
use to implement both “delete all buffers but one”, or “jump to buffer by name” and more … after all, the buffer switcher is actually “just” an other text file !