Kakoune: Fill regular buffer as Kakoune entry point

Created on 11 Jul 2017  Â·  6Comments  Â·  Source: mawww/kakoune

Most helpful comment

I think I see what you mean.

Sometimes, you start kakoune, write some stuff in the default *scratch* buffer and want to save your progression :w foo.txt. You keep going writing stuffs and want to save again with a simple :w. It raises an error because the current buffer is still not linked to a file. So maybe the first :w foo.txt could transform the scratch buffer into a regular one.

All 6 comments

I think I see what you mean.

Sometimes, you start kakoune, write some stuff in the default *scratch* buffer and want to save your progression :w foo.txt. You keep going writing stuffs and want to save again with a simple :w. It raises an error because the current buffer is still not linked to a file. So maybe the first :w foo.txt could transform the scratch buffer into a regular one.

I wish :w <file> would set the buffer name to <file> instead of retaining it. It is what vim does I think.

@danr Would that do it for any buffer ? Say if I edit a.txt and do :w b.txt, would that rename the buffer to b.txt ? Or would that be the behaviour only for scratch buffers ?

Adding a side effect to this pure command would probably bend its orthogonality, but I suppose that's what most users use it for anyway?

nvim does this only for *scratch* buffer, but to be honest I would prefer this behavior to happen in all cases, i.e. I would prefer to be switched to buffer b.txt.

How about filling a splash buffer as _New document_?

All other editors do this, when editing a new document with no file-name yet. They don’t allow to quit before yelling for unsaved changes.

I think it’s prone to accidents for Kakoune and new-comers to have a scratch buffer as its entry-point, instead of a regular one.

In conjunction to #2360, write document.txt would rename *splash* → document.txt.

*splash* is just a name for a normal buffer when no explicit name was given.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

basbebe picture basbebe  Â·  4Comments

alexherbo2 picture alexherbo2  Â·  3Comments

alexherbo2 picture alexherbo2  Â·  3Comments

akkartik picture akkartik  Â·  3Comments

radare picture radare  Â·  3Comments