top | item 21993957

(no title)

jessant | 6 years ago

command wq <nop> command w <nop> command q <nop>

discuss

order

tynorf|6 years ago

Unfortunately:

  E183: User defined commands must start with an uppercase letter

jessant|6 years ago

command W <nop>

cabbrev w <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'w')<CR>

cabbrev q <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'q')<CR>

cabbrev q! <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'q!')<CR>

cabbrev wq <c-r>=(getcmdtype()==':' && getcmdpos()==1 ? 'W' : 'wq')<CR>