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.
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.
@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.
@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.
@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 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? :)
@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.
@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.