6 ms·
There's nothing worse than reflexively typing ctrl+z to undo in Emacs and instead have the window disappear into the background!
by isolli 5y ago
There's nothing worse than reflexively typing ctrl+z to undo in Emacs and instead have the window disappear into the background!
- ajross 5y agoIn my .emacs since time immemorial: (global-unset-key [(control z)]) It's absolutely true that defaults are "bad" in many modern environments (though remember C-z to suspend in a terminal environment makes perfect sense!). But the nature of the editor is customization like this. People unwilling to do this just aren't ever going to be happy with emacs. And for those just learning, tricks like that (c.f. emacswiki.org) are a very reasonable entryway into a world of possibilities. I mean, look, Emacs isn't ever going to be VSCode. If you want VSCode, use VSCode. It's a great editor, and frankly at this stage I think nothing is going to do VSCode better than VSCode already has. Emacs is something different, and we might as well embrace that. (Not that I'd object to switching some of the dumb defaults around, of course. I just don't think that's going to help very much if your goal is "displace VSCode").
- teddyh 5y agoCtrl-z for suspend is useful in the terminal, though, so maybe something like this? (if window-system (global-set-key (kbd "C-z") 'undo))
- tom_ 5y agoSuggested tweak: (when window-system (global-unset-key (kbd "C-z")))
- ajross 5y agoNope. Again, context matters here. I never use emacs in a terminal; all editting of files on remote systems is done in a local X11 emacs over ssh. And this is not because of circumstance but because making that choice opens up more doors. I can have keybindings not just on C-z but ones that aren't representable in the terminal at all (e.g. I like to put end/beginning-of-buffer on C-. and C-,) Would I submit my choices as good defaults for new emacs users? Hell no. But they remain good choices nonetheless. That's the essence of my point, not the minutiae.
- servilio 5y agoThe recommended way to do this now seems to be: (when display-graphics-p (global-unset-key (kbd "C-z"))) Also, though this works with Emacs running as a server, I find it better to just quit emacsclient instead of learning to do something different depending on what environment it is running.
- babypuncher 5y agoI find this at least a little frustrating. I haven't used Emacs, but when using other apps that use non-standard defaults (or just defaults that I am not used to), changing one shortcut leads to a cascade where I have to change many shortcuts. I now have to spend a somewhat significant amount of time configuring a new piece of software before I even know if I actually like it. Shipping with some easily configurable presets to mimic other popular tools would probably help new users a lot.
- a_e_k 5y agoEven better, I repurposed C-z as the prefix for all my custom bindings. That's got a couple of advantages: 1) I don't have to worry about finding free bindings under C-x, C-c, or at the top level. Those spaces are pretty crowded with out-of-the-box bindings. 2) C-z C-h automatically gives me a nice list of my custom bindings. (For the very rare times when I actually want to suspend Emacs in a terminal, I don't mind typing out M-x suspend-emacs RET.)
- ReleaseCandidat 5y agoActually, there is. Typing `C-x C-s` in a 'normal' Editor. Always happens to me :(
- isolli 5y agoSame here! It's just easier to undo :)
- foobarian 5y agoYou guys both got nothing on pressing Cmd-W on a MacOS terminal when you intend to copy a selection. :-( I swear whoever designed that UI must have been a vi partisan.
- b3morales 5y agoI found it better to make Option (rather than Command) be Meta for this reason.
- bluecatswim 5y agoYep, for me it's this. I don't know why others are complaining about the other way around, maybe it's because I thought of Emacs as being different from other editors right from the get go, but I doubt I've ever accidentally entered CUA shortcuts in Emacs. But Emacs shortcuts in normal editors while using school PCs was something I did all the time.
- kwhitefoot 5y agoDone that about a dozen times today!
- jyriand 5y agoOr while cutting a text in browser and typing ctrl+w, thereby closing the tab.