I enjoy seeing other people's #Emacs key bindings, as they're often quite different from my own. In that spirit I've made a list of some simple ones that I can't live without.

If anyone has their own list, I'd be happy to link to it.

https://wiki.plexwave.org/useful-emacs-key-bindings

Useful Emacs key bindings

@spnw I used to have a lot of them too but a while ago decided to only create keybdings if they don't already exist and deleted most of them.
@tusharhero I can respect that. My init.el is almost 1300 lines long, which is absolutely insane when I stop to think about it.
@spnw yeah my reasons were mostly cognitive overload of trying to design a proper keybindings set for myself. I have a literate configuration of around the same size I think ( I don't know how much it tangles to). But nowadays I just use customize for a lot of stuff as I need, so don't put them in init.el
@tusharhero I used to do the literate thing too, though it's been a while. And customize probably doesn't get the respect it deserves from so-called advanced users, myself included. :)

@spnw I have too many key bindings defined to list them all here. However, in the vein of what you posted, one key binding of mine fits in:

(keymap-global-set "C-x o" 'ace-window)

which allows me to switch to any other window by typing a number. This binding is key due to my use of two large monitors simultaneously and typically having 5-8 windows visible. The default binding for that key, even with repeat mode, is not fit for purpose in such an environment.

#Emacs

@ericsfraga ace-window actually inspired my M-o setup. I thought to mention it but I forgot what the package was called, ha!

I think if I had as many windows as you I would need it, but I tend to be on one monitor, two or three windows max.

@spnw I use the keypad a lot and try to avoid chords. I think it’s good ergonomics.

@tzz Do you mean binding commands to special keys? I'm curious about your setup.

For me chording is a necessary evil, as I prefer small keyboards and have turned away from the modefulness of vi/evil.

@spnw I just have global bindings for things like KP Enter for consult, KP dot for other-buffer, F2 for ripgrep, and so on. My most used commands are accessible without any chording. No modal anything.

@spnw I use keyboard macros a lot, so I setup things so:
- M-r runs the command kmacro-start-macro-or-insert-counter
- M-m runs the command kmacro-end-or-call-macro
- M-M runs the command apply-macro-to-lines-of-paragraph

The first two are bound by default to <f3> and <f4>, but I find M-r (r for "record") and M-m (m for "macro") easier to type, because the functions key are (1) kind of far away, and (2) require the fn key on my laptop. The third command apply-macro-to-lines-of-paragraph, is one I wrote to automatically apply the macro I'm recording on the first line of a whitespace-separate paragraph of lines to each successive line. It feels like magic to use it.

@oantolin That's pretty clever. I never found a good binding for keyboard macros, but I do use them a fair bit.

I might have to give yours a try. Do you happen to have that custom command posted anywhere? :)

emacs-config/user-lisp/text-extras.el at 6affdccb828876648fc8cafb4efede099e3ada77 · oantolin/emacs-config

My personal Emacs configuration. Contribute to oantolin/emacs-config development by creating an account on GitHub.

GitHub

@spnw I have very similar ones for other-window and kill-current-buffer, but I ‘standardized’ on C-s- as modifiers for that sort of manipulation, so they're on C-s-o and C-s-k. (I rarely have more than two simultaneous windows per frame, so I don't need the opposite-direction other-window.)

Is bury-buffer/unbury-buffer that good? I have C-s-( and C-s-) for previous-buffer and next-buffer…

And *scratch* is part of my global quick buffer access group which has a prefix of f8 b.

@dasyatidprime Come to think of it, I probably don't use bury/unbury as much as I used to, but it's handy to have around. I think I'll have to try that next-buffer thing!

By quick buffer access do you mean registers? I use registers a lot, but *scratch* is such a common thing for me to pull up that I like having an even faster shortcut for it.

@spnw Hmm, I barely use position registers and should probably use them more for when I'm swapping between a few different buffers… though I suspect the vanilla bindings (C-x r SPC to set, C-x r j to jump) would be good enough for me.

My f8 b ‘submenu’ is mostly hardcoded (can you say “legacy user”? there's a little ad-hoc thing to allow o for other-window in the middle). s is for plain *scratch*, but then capital S visits a timestamp-named file in ~/tmp for slightly more persistent scratch.

@spnw (By comparison, I use string-valued registers quite a bit when I have e.g. a bunch of identifiers that start with the same long prefix. C-x r x s, C-x r i s or whatever…)

@dasyatidprime My use of registers is limited to opening (hardcoded) files that I need often. I've forgotten (or never learned) a lot of the more interesting things you can do with them. I like the sound of that copy-to-register workflow.

Semi-persistent scratch is a cute idea. I hate having to name things.

Thanks for giving me some interesting things to think about.

@spnw M-F and M-B for forward-to-word and backward-to-word are nice sometimes.
@thetemp Very nice! I didn't know about those commands.