Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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


Unfortunately:

  E183: User defined commands must start with an uppercase letter


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>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: