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

Is there a way to exit without using the ":" key?

I ask because the other day I saw a friend of mine legitimately get stuck inside vim because he coundn't type ":". The keyboard language was set to the wrong language and none of the keys would output ":" when pressed. We had to reboot the machine and find a different keyboard.



ZZ will save and exit, or ZQ to exit without saving.


Ha ha, I don't know about nowadays on Windows/Linux/MacOS (maybe someone else can comment for that), but on DOS, you could get around such issues (like a key damaged or not present) by holding down the Alt key while entering the 1- to 3-digit ASCII code for the key you wanted to enter (0-255). That was used for all kinds of tricks and jokes in those days, like entering a fake space kind of key - some ASCII code while pressing Alt - I forget which one, maybe 255. It would look like the space char on the screen - a blank - but was not the same char. Could be used to create "hidden" files that those not in the know could not access, although the file was otherwise in plain sight in DIR listings and so on :)


Ctrl-Z to suspend and then you can kill the job


Yanking the power cord usually does the trick for me too.




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

Search: