Hacker News new | past | comments | ask | show | jobs | submit login

> The default keybindings for said commands are cursed.

Default keybindings are a curse.

Software in general would be so much better if keybindings were always explicitly part of the user's configuration. Despite that being technically the case in Emacs, the reality just isn't as practical as it should be.

Every default keybinding brings an assumption into UI/UX. That assumption can never be removed: it can only be moved.




The problem is designing coherent usable keybindings is a large undertaking.

Plus things like C-c C-f and similar working throughout many different elisp packages in a predictable useful way is super valuable.


its a huge problem. Firefox for example could not agree on what the binding for PiP should be on non US/UK keyboards, and had an impossible binding of Ctrl-Shift-] (where "]" requires an Alt on some keyboards).

https://bugzilla.mozilla.org/show_bug.cgi?id=1611154


Yeah, I'm confused on what the complaint is? Is the desire that it is always explicitly coded in a config file? You could probably dump the keymap to a file on initial load?

You could extend that so that if default is different from the last time it was loaded, you could let the user know, and then replace with any user defined one. (Letting user know is mainly so they can decide if new commands need mapping.)

That said, I'd hazard this is not that useful?


Yea, that doesn’t make much sense to me either. Maybe they should go to whatever Emacs buffer they have open and type `C-h B` to dump out the entire list of keybindings available in that buffer. That will probably disabuse them of the notion that the user has to personally invent all of them. Mine is 2.4k lines long! And that’s just for the modes that I happen to be using for that particular JSON file; many of the key bindings in a C++ or Rust file would be similar, but so many would be completely different.


> Mine is 2.4k lines long!

Are you telling me you actually use 2,400 key bindings?

If you do, then would it really be that hard to invent them yourself?

If you don't, then what good are all of these keymaps actually doing you?

I'm not advocating that you should have to reinvent your keymap. I'm advocating that you should be able to.

Emacs is the very best case available: it's technically possible! Nearly everything else demands we learn its own opinion, instead of implementing our own.


I don’t know them all, no. But it would be absolutely ridiculous to force a new user to try to design a set of key bindings for even the hundreds that I do use. Nobody can predict ahead of time which ones the user will learn over the years that they use an editor, or even which combinations of features they will enable.


So don't force them to.

And don't force them not to, either.


Like I said, yes, in emacs it is technically possible.

But you still have to redo the keymaps defined in every package you use; and you have to know what they are in the first place.

You can replace single bindings one at a time easily enough. You can't change them all without a two-step effort. We could eliminate step one for anyone, like me, who's is interested.

There's a reason that evil-mode took so much effort to put together, and it still has serious edge cases. I want to make my own original modal editing keymap. I have tried many times, and given up. It's too much work to both see what to change in the first place, and to remove the default; and that's what it takes to just get started!

Picture this: you are learning to use Emacs for the very first time. What are you learning? Today, the answer is C-n, C-x C-s, etc. My alternative is to learn the functions instead. If you don't have an opinion about what key should be bound, then use someone else's config. This way you can actually comprehend your entire configuration! It doesn't need to be mandatory, but I would love the opportunity.


What I'm saying is you can automate a fair bit of this. When a new keymap is loaded, dump it and let the user know of it.

Things are super complicated with this general idea, though, as don't forget that the standard letters are also basic keybindings. People can and do take advantage of that fact. Right? I'm assuming you would not want those to be special cased here?


You can in Emacs, though you must first learn how. Last time I tried, I gave up.

Emacs is, by far, the best case. Even if I did get Emacs to behave exactly how I wanted, I can't apply that to any of the other software I use.


Ah, my apologies. I took your initial post to mean that even emacs doesn't get what you wanted. You mean largely that it is not the advertised path, even in emacs where it is technically possible. Makes sense.

The level of introspection you can do in emacs is something I wish all programs had. Being able to ask the program, "what were the last commands you saw?" and "what would you do if I did {something}" are huge.


For plugins maybe, but coming up with a thoughtful set of key bindings takes work. If everything is reconfigurable, like with Emacs, I don’t see the harm in giving users something to start with.


Just coming up with evil bindings for modes before evil-collection was hard enough :)


Evil-mode is an example of what I am advocating here.

Imagine if evil-mode could start with a blank slate. Wouldn't that be easier?

The problem is that every package is designed to integrate with regular default-Emacs. If you are using evil-mode, that means every package presents its own edge case.


Emacs originally was a set of macros to standardize key bindings across multiple editors that existed at the time.


Not exactly. It was a set of macros, yes, but the goal was an improved editor, not a standardized interface. Later there were multiple ports which shared many things in common, such as key bindings, on–line help, etc.


No, it was a standardized interface. Guy Steele talked about going around the office collecting keybindings from multiple people and distilling them down into a standard set.


But not from users of multiple editors. They were all users of TECO who had written their own macros to add similar features.


I'm not sure where you're going with this. A bunch of people wrote macros for TECO. Moon and Steele collected them and standardized them. The set of standardized macros is Emacs.

Thus, Emacs originally was a set of macros to standardize key bindings across multiple editors that existed at the time, exactly as GP said.


libreadline


> Software in general would be so much better if keybindings were always explicitly part of the user's configuration.

So you'd open up Emacs, and the only thing you'd be able to do is insert and delete text? No "beginning-of-line", no "find-file"? That seems...even less newbie-friendly than Emacs currently is.


No, inserting text is a command (it's the self-insert-command). Presumably how it would have to be done is when some software (like Emacs) launches it'd prompt the user for every required keybinding.


That concept breaks down with the multiple thousands of default key bindings in a typical Emacs setup (source: go into an org buffer press C-h b, then go to a Python buffer and press it again, and so on)


I'm not advocating we ban the default keymap. I'm advocating that we move it.

You may like it fine, but I find it in my way more often than not.

What does it truly mean to be newbie-friendly? Are you trying to teach them the functionality of your software, or your opinions about how to use it? Why not teach newbies (find-file) first? Would that really be so bad? Why not give them both options?


The fact that ctrl+c copies on my computer and I can expect the same at my mom's computer or my friend's computer seems like a blessing not a curse.




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

Search: