I've gotten in the habit of doing dd (assuming just a single line in the
buffer) before exiting (if I don't want anything to be executed).
Yes, either that, or, (if the typed command will have no bad effects)
just accept the error message.
Incidentally, I agree that the best solution would be if vi (which is
usually vim these days) could return some non-zero exit code in this situation. I'll bet that could be done with some fancy vim scripting; whether it would be worth the trouble or not is another matter.
It would be interesting to know if the shell would recognize the non-zero exit code and do the right thing. I'll have to test that at some point (in bash).
Incidentally, I agree that the best solution would be if vi (which is
usually vim these days) could return some non-zero exit code in this situation. I'll bet that could be done with some fancy vim scripting; whether it would be worth the trouble or not is another matter.
It would be interesting to know if the shell would recognize the non-zero exit code and do the right thing. I'll have to test that at some point (in bash).
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 497 |
Nodes: | 16 (2 / 14) |
Uptime: | 11:46:00 |
Calls: | 9,783 |
Calls today: | 2 |
Files: | 13,748 |
Messages: | 6,187,342 |