reddit / emacs
I think I’m onto something (another keybinding post)
guitmz · 2022-07-22 23:29
So I have (macos):
- emacs keys, not evil
- caps lock mapped to control
- left option as meta
- left command as super (not sure if I should change this to meta yet)
- right command mapped as F7
This looks somewhat sane and I can easily bind the menu key in other keyboards to F7 (or other F key) as well.
F7 is a prefix key and I’m using it as something similar to general.el as in “<f7>w” opens a prefix for my windows commands for example (like SPC w in doom or whatever).
I wanted to map right command to hyper but that does not play nice with macos terminals.
This is looking very nice to me, I honestly was not fully aware I could achieve this as I’m somewhat a beginner.
I was using a lot of chords too but I reduced their usage due to some conflicts. They are still pretty awesome to have though (a quick “tt” opens vterm-toggle for example).
Does this look sane to you guys? Is it too good to be true?
HM0880 · 2022-07-23 01:39
I map the key on the spacebar's right (Alt on Windows; not sure on Mac) to Control. Then left thumb is for Meta, and right thumb is for Control.
snubbyJspreaker · 2022-07-23 02:33
you do you. if you are comfortable with the way your keybinds feel then who can say you are wrong?
cazzipropri · 2022-07-23 02:57
You do you. I went down a completely different rabbit hole and I feel ashamed to describe it. Key bindings are like underwear. Everybody got their own, and it's probably not worth doing show and tell.
guitmz · 2022-07-23 05:29
Yeah this could be an interesting variation to me to try. This is the key I’m talking about, that I mapped to F7
HM0880 · 2022-07-23 20:36
Oh, I missed that at first. I thought you bound F7 to Control, haha.
arthurno1 · 2022-07-23 23:44
:-) That was the best description I have seen to date :). Indeed.
cazzipropri · 2022-07-24 01:50
Thanks!
guitmz · 2022-07-24 05:56
Ah no
Left command im changing to meta
Right command is F7 (i wanted hyper but apparently I don’t know how to make hyper to work as a prefix key)
The downside of using command as meta is that terminal emacs will not work properly due to macos limitations
redblobgames · 2022-07-24 16:37
Sounds sane. But almost every mapping seems sane to me. Everyone's needs are different so it's sane if the mapping matches your needs :-)
I also have caps lock mapped to control, left option as Meta, left command as Super. In my case, I want command to be mac-style keybindings (so command-C is copy) so I have option for emacs-style keybindings (so option-C is capitalize). I have right command on Alt but I don't use it. I have right option for option so I can type special characters lik ø and ∆. I decided to reclaim Ctrl+digits, so C-0 through C-9 are various commands (including some prefix keys).
guitmz · 2022-07-24 16:44
Yeah I actually started thinking about reclaiming digits too. What do you do with them if i may ask? As in how do you organize
redblobgames · 2022-07-24 17:45
Since emacs gives me *four* [ways to enter prefix arguments](https://www.gnu.org/software/emacs/manual/html_node/emacs/Arguments.html) (C-digit, M-digit, C-M-digit, and C-u digit), I decided to reclaim the C-digits for commands that I use often. Window management:
- `C-1`: delete-other-windows (`C-x 1`)
- `C-2`: split-window-below (`C-x 2`)
- `C-3`: split-window-right (`C-x 3`)
- `C-0`: winner-undo
- `C-9`: rotate-windows (considering changing this, as I don't use it often)
Others:
- `C-4`: align-regexp (considering making this a prefix for aligning+sorting)
- `C-6`: mc/mark-next-like-this (multiple cursors)
- `C-8`: prefix command to insert my most commonly used unicode characters
Considering binding:
- `C-5`: for macros maybe
- `C-7`: for some other multiple-cursor command
- `C--`: maybe snippets? not sure
- `C-=`: dunno
- `C-` `: dunno
guitmz · 2022-07-24 17:49
Nice, thank you!
HM0880 · 2022-07-24 20:42
Gotcha. Yeah, I have trouble with iTerm and Meta on MacOS.
I think Hyper is a modifier key (like Control or Meta), so I don't think Hyper can work as a prefix key like F7 can. You can "chain" prefix keys, so I use `C-c c <key>` for misc custom commands and `C-c w <key>` for window management commands.
guitmz · 2022-07-24 22:12
This is how i started, but i felt like pressing C-c all the time was a bit too much. I can be wrong though, I’m experimenting to see where it leads me, we’ll see
HM0880 · 2022-07-25 00:00
It's not so bad pressing `C-c` all the time; I've gotten very fast at it. Trying different keymaps is a lot of fun for us nerds haha, so keep trying new things!