Open yaohunzhanyue opened 4 years ago
https://stackoverflow.com/questions/61100302/is-there-a-way-to-overwrite-vims-default-command
I want to map :bd to :bd! using:
:bd
:bd!
command! -nargs=* -complete=buffer bd :call bd!
but vim told me "User defined commands must start with an uppercase letter"
update solutions from answer:
cnoremap bd bd!
another way
cnoreabbrev <expr> bd getcmdtype() == ":" && getcmdline() == 'bd' ? 'bd!' : 'bd'
https://stackoverflow.com/questions/61100302/is-there-a-way-to-overwrite-vims-default-command
I want to map
:bd
to:bd!
using:but vim told me "User defined commands must start with an uppercase letter"
update solutions from answer:
another way