Speaker: Robert Mugabe has resigned. #ImpeachMugabe
— Open Parly ZW (@OpenParlyZw) November 21, 2017
Ever lost an unsaved file in Atom editor, because you accidentally pressed shift-cmd-W (close window without confirmation) instead of shift-alt-W (wrap selection in tag)?
Atom can restore a session when you close a previously saved file with unsaved edits, but it won’t (as far as my knowledge and agonizing experience go) restore a file that has not been saved before.
Solution: Add a custom keybinding to redefine the shift-cmd-W command.
- Atom→Keymap… to open keymap.cson.
- Add the following and save the file:
'body': 'shift-cmd-W': 'core:close'
This basically duplicates the behavior of cmd-W for shift-cmd-W. Atom will nicely ask for confirmation before closing the file and sending your edits to Walhalla.
I use Atom to edit/write plain old HTML a lot, and I have no use for a command that would delete unsaved content without confirmation, so this works for me.
Should have done this way earlier.