by freetonik · 6y ago · 0 comments
Just to name a few:
- CMD+left/right: start/end of line
- CMD+up/down: start/end of file
- CMD+Shift+arrows: corresponding selection
- Alt+left/right: word movement
- Alt+Shift+arrows: corresponding word selection
- CMD+a: select all
- CMD+1,2,3: switch between tabs in browsers/iterm/IDEs/editors
(surprisingly and infuriatingly, this does not apply to native macOS tabs; e.g. in Finder Cmd+1/2/3 changes the view, but not tabs)
All that + the fact that clipboard, undo/redo, app and windows switching are ALL done via CMD makes it truly a modern hyper button. And you still have Control for Emacs bindings, which also work in most Cocoa text fields.
If you're interested, this [1] is one of the best attempts to bring macOS keybindings to Linux (in particular, Elementary OS). It's a set of settings for Autokey [2].
There is also Kinto [3], which solves one particular problem: copy-paste from terminal with consistent shortcuts.
1. https://github.com/roymckenzie/macos-autokey-phrases
2. https://github.com/autokey/autokey
3. https://github.com/rbreaves/kinto
UPD: edit formatting
Of course some laptops don't have end/home/page up/page down keys and you have to avoid those.
You have answered your own question. It's home/end, Ctrl and Windows keys where in macOS it's always CMD+something.
I would assume the keyboard UX would be a low-lying fruit. I'm hoping someone with deep knowledge about linux can help me understand what is stopping various distros from simply copying the mac keyboard layout. Replace 'cmd' with the 'super' key and setup the key combinations to match macOS. That way they're consistent whether you're in a GUI application or the command-line.
Is it that the super key is not available on every computer? Or are these shortcuts protected by some sort of a copyright? Kinto seems to work by intercepting signals and reinterpreting them, then why not have the X keyboard component recompiled with a macOS keymap? I'm not at all knowledgeable in this area, so may be missing some very obvious challenges to doing so.
When I left Mac 8 years or so it was quite the opposite:
- home and end depended on application, the only one that worked consistently was ctrl - e and ctrl - a but they didn't work with shift so select to end of line was hit and miss
- one of the shortcuts that sometimes worked was cmd - left, unfortunately that was mapped to go-back-one-page in Safari. Kknd of annoying when you try to select a sentence in a form and end up losing all your carefully crafted edits.
- fn button in the place where ctrl is supposed to be, but only on laptop and small keyboards, not on the full size one. Not remappable (I understand this is fixed now).
I struggled with that machine for three years. After that I realized that Macs are perfect - for Mac people, not for Linux peasants like me.
Some applications take you to the top of the page with Home, some take you to the beginning of the line.
Are you sure you didn't hold ctrl down at the same time?
Edit: anyone else has experienced this on Windows without combining with ctrl?
Home/End always worked for me on Windows and didn't work for me on mac until I did a ton of tweaking.
My Dell laptop has Fn keys on the left/right arrow that do home/end in the same way it sounds like Macs do.
And thankfully, the Safari bug/inconsistency has been fixed. In all the major browsers on macos now, CMD+left will behave like "beginning of line" when you're in a text box.
I feel your struggle though, as someone who frequently has to / chooses to use Win/Linux, I don't think I'll ever end the fight against the shortcut patterns that have been ingrained in my hands.
- home/end: start/end of line
- Ctrl + home/end: start/end of file
- Ctrl + Shift + home/end: corresponding selection
- Ctrl + left/right arrows: word movement
- Ctrl + Shift + left/right arrows: corresponding word selection
- Ctrl + a: select all
- Alt + 1/2/3/...: switch between tabs in Chrome and VSCode where I tested it, don't know if it is working in ALL apps, for example it does not work on alacritty+tmux (where I spend most of my time) for obvious reasons.
I don't know about the consistency, but some of these make more sense semantically, like Alt+1/2/3 - "alternate to a different tab".
setxkbmap -option ctrl:swap_lalt_lctl
I change Cycle Windows to Ctrl+Tab in the Window Manager. I disable menu Alt keys where I can.I use AutoKey for Terminal so that it works like Terminal in Mac OS X: Copy and paste and other Application shortcuts do not require using a shift key. Alt+C is the kill key (control-c) and all the rest of the Alt keys work like control keys in the terminal.
And yes, despite the non-trivial amount of tweaking and customization, I could never achieve the same level outside of Mac OS X.
That behaviour predates native tabs on the Mac, historically it even predates Safari and other browsers with tabs, I believe.
⌘1,2,3 in Safari for a long time selected favourites in the favourites bar. There is still a setting to still do that. I use it for useful bookmarklets.
Chrome: - Shift+Home/End selects to the start/end of the entire textarea. - Home/End first scrolls the textarea, if it is not, if it is already scrolled (this is double weird if you are somewhere down in the textarea, press home, it scrolls you to the top, press home again, it scrolls you back to where you were with the cursor on beginning of the line, then it goes to the start/end of the line as expected.
Safari: - Home/End only scroll the page, have no effect in textarea, - Shift+Home/End selects to the start/end of the textarea.
Also, I can't get insert to work in none of my IDEs (pycharm, vscode)
If anyone knows of a way to rebind Alt+left/right to mimic the behavior, please give me a shout out. I’ve tried to reproduce with remapping to Home/End but I’ve found it really inconsistent.