mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.97k stars 714 forks source link

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

Open Delapouite opened 6 years ago

Delapouite commented 6 years ago

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

mawww commented 6 years ago

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.

lenormf commented 6 years ago

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.

Delapouite commented 6 years ago

I think we need at least to have switch completion

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

Delapouite commented 6 years ago

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