Kakoune: Replace `*!` commands by a -force switch? (i.e. write! -> write -force)

Created on 28 Apr 2018  Â·  4Comments  Â·  Source: mawww/kakoune

Hi

There are several commands that are also available in bang versions (more destructive):
edit[!], write[!], kill[!], quit[!], write-quit[!], delete-buffer[!].

I think this terminology came from vim legacy where commands tend to be agglutinations of chars whereas Kakoune uses more explicit arguments / switches. Example: vim's nmap vs Kakoune's map normal.

What about removing the bang versions in favor of a descriptive -force switch?
Example edit! … becomes edit -force …

Pros

Cons

  • users who use :wq! frequently will need to add it to their kakrc.
design

Most helpful comment

Between :q! and :quit -force, I'll pick the first any day, even with completion. The first syntax is too convenient to disappear over night, it should stay.

All 4 comments

This is a good candidate for the big-breaking-tidy-up. I am wondering about that, I think we need at least to have switch completion so that -force is easy to write.

The other problem is that its actually not possible for users to create those back, aliases are limited to command names, they cannot contain switches, and defining a custom wrapping command will not be able to use !. I think we cannot make this change before we have a nice way to users to put that back in their config easily.

Between :q! and :quit -force, I'll pick the first any day, even with completion. The first syntax is too convenient to disappear over night, it should stay.

I think we need at least to have switch completion

https://github.com/mawww/kakoune/issues/1467

Related discussion about bangs: https://github.com/mawww/kakoune/issues/2110

Was this page helpful?
0 / 5 - 0 ratings

Related issues

abitofalchemy picture abitofalchemy  Â·  3Comments

dpc picture dpc  Â·  4Comments

lenormf picture lenormf  Â·  3Comments

hwmack picture hwmack  Â·  4Comments

akkartik picture akkartik  Â·  3Comments