Micro: Custom keybinding for "Quit, without saving" possible?

Created on 12 Oct 2018  路  4Comments  路  Source: zyedidia/micro

Hi

I've tried to define a custom keybinding for "Quitting without saving", i.e. a keybinding that automatically enters "n" in the "Save? y/n/escape" dialogue that follows a Quit command in a changed file. My first idea was something like:
"CtrlQ": "Quit,"N",
but I realize that doesn't work, since "N" is a key event, not a command. Next attempt:
"CtrlQ": "Quit,"command:echo'n'",
but that's wrong on several levels I guess.

Anyway, I'm fresh out of ideas. Is this even possible, given the limitations of both the (OS X) terminal, and the available actions defined by Micro?

All 4 comments

@zanglebert oh no, you shouldn't create such shortcut key, it's basically not safe.

@datdinhquoc Care to explain why it's not safe? I'm not suggesting to only have a short cut like that, but in addition to the default behavior.

Here's the reason why I want to define it: I frequently open files I don't want to make changes to, but read them in Micro nonetheless. I also frequently mistakenly edit them anyway (fat finger etc), then have to go through the save dialogue, carefully checking that I don't save by accident. Having a key that closes without saving is useful here, and I don't know why you'd consider it unsafe.

then you will have habit of pressing such shortcut key, and hey ho, one day you forget to ctrl+s before exiting directly that way.

+1 need this feature

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Mohamed3on picture Mohamed3on  路  3Comments

aerth picture aerth  路  4Comments

GeigerCounter picture GeigerCounter  路  3Comments

Calinou picture Calinou  路  3Comments

bitcoinmeetups picture bitcoinmeetups  路  3Comments