I highly recommend everyone learn the readline keys. They apply everywhere, in chrome, messengers, etc. They're the most valuable hotkeys that I've learned other than learning vim.
I set them as the Message Of The Day in my .zshrc (or .bashrc if you don't use zsh) until I memorized them. <c-f> is genric formatting for hotkeys, where c stands for control and you type "f" at same time.
IMPORTANT: For these to be level extremely effective you MUST REMAP your caps lock key to a control key. System Prefs > Keyboard > Modifier Keys button at bottom right
# MOTD
function echo_color() {
local color="$1"
printf "${color}$2\033[0m\n"
}
echo_color "\033[0;90m" "c-f Move forward"
echo_color "\033[0;90m" "c-b Move backward"
echo_color "\033[0;90m" "c-p Move up"
echo_color "\033[0;90m" "c-n Move down"
echo_color "\033[0;90m" "c-a Jump to beginning of line"
echo_color "\033[0;90m" "c-e Jump to end of line"
echo_color "\033[0;90m" "c-d Delete forward"
echo_color "\033[0;90m" "c-h Delete backward"
echo_color "\033[0;90m" "c-k Delete forward to end of line"
echo_color "\033[0;90m" "c-u Delete entire line"
Imagine you want to go up 2 lines to edit a HN comment. You could move your right hand to arrow key, or you can simply press caps with your pinky and type "p" with your other pinky. So much faster! Now you can see why these are so effective, and are really my favorite.
Note that as you start to use these you will be pleased to see they apply in a lot of applications. For example, type command+L in chrome to jump to the address bar and highlight it, now type "news" in the address bar. The autocomplete dropdown will pop up. Now type control+n (readline move down) and you can scroll through the list.
MOTD - message of the day, it's the small text blurb that's printed when you start a new shell instance on linux or mac computers. Not sure if it's a thing on windows.
Which (readline, that is) is used in tons of command line programs, shells, REPLs, etc. to parse user input. So if you know the shortcuts you can apply them in tons of programs...
If you don't use MOTD, putting the shortcuts you wanna memorize in a macOS sticky note works great. Or editing them into your desktop image. Or a legit paper sticky note / label printer label stuck to your monitor - no screen real estate gets consumed that way
As someone who uses the above constantly in Mac OS, including while typing this comment: Is there a way to make this happen in Linux—to have all those commands work in (the majority of) text fields across all applications, and to have Linux's original meaning of "c-a" (Select All) and so forth be accessible via "(Windows key)-a"?
My ctrl key seems to mimic my Command key for most of these command and not do anything in other cases (Firefox & Word). Is there some setting I need to change?
I'm using these keybindings in Firefox right now, without any custom config (other than mapping caps lock -> control). Go to the URL bar and hit control-a and control-e; do they work? Type a few words of a reply comment, and in the comment text field, try control-a and control-e; do they work?
Neither of those programs use readline. I map ctrl-e to end of line in Word because I use it so habitually. Safari uses these shortcuts as does terminal.
The ergonomics are terrible, aren't they? I suppose in your case I'd probably use my pinky and suffer.
My Air has a JIS keyboard, so the control key is where your caps lock is. Most of my keyboards are configured this way (either physically or in software); on those that aren't, I use my opposing palm to press ctrl. I can't imagine using a Mac with flat keys and no right control =(
I use karabiner elements to remap caps to ctrl for most chords, also it will act as escape if hit alone and it will act as the arrow keys when used with hjkl like in vim. and finally it will act as caps lock if you press it with right shift. pretty awesome setup.
I edited my post. You absolutely must rebind caps to control. One of the best changes I ever made, and I regret that I didn't add that to my post after so many people have seen it. Thanks for reminding me
Because I make lots of use of control, I usually map Right Command to Right Control, so I can easily thumb control, command or option at practically any time.
You’re right, I confused it but my point still stands.
What I really meant to say:
Not really because unlike c-u, the c-a c-k combo deletes the whole line, while I actually wanted to delete only the part of the line up to the cursor. My workaround is ⇧⌘← followed by Backspace but that always feels a little awkward to me.
I can confirm that C-u has the behavior I described for me. Running Mojave. It's very useful at times in terminal as a sort of "reflected" C-k shortcut.
Because it allows you to type these hotkeys by moving your pinky 1 key to the left, which is orders of magnitude easier than the control key at the bottom left.
You can only jump by word, forwards and back, by holding the option key while using the arrow left and right.
Backspacing however can be done by word by using c-w to delete back by word. Unfortunately this hotkey only works in terminal I think, so you'd have to do option+backspace in chrome, etc.
Tools > customize keyboard. Select the All Commands category to see all possible shortcuts. You can adjust some shortcuts to match readline shortcuts. C-n, p, f, b, k, a, and e are all possible. Even Cmd-f and Cmd-b for forward word and backward word can be done. Some of these do override existing shortcuts. Also, this can’t be done for PowerPoint.
Microsoft has implemented their own text controls system in their apps. It's annoying as heck to me. I should say it's not true in Teams and OneNote. I'm guessing they are electron apps.
I set them as the Message Of The Day in my .zshrc (or .bashrc if you don't use zsh) until I memorized them. <c-f> is genric formatting for hotkeys, where c stands for control and you type "f" at same time.
IMPORTANT: For these to be level extremely effective you MUST REMAP your caps lock key to a control key. System Prefs > Keyboard > Modifier Keys button at bottom right
Imagine you want to go up 2 lines to edit a HN comment. You could move your right hand to arrow key, or you can simply press caps with your pinky and type "p" with your other pinky. So much faster! Now you can see why these are so effective, and are really my favorite.Note that as you start to use these you will be pleased to see they apply in a lot of applications. For example, type command+L in chrome to jump to the address bar and highlight it, now type "news" in the address bar. The autocomplete dropdown will pop up. Now type control+n (readline move down) and you can scroll through the list.
I'm obsessed with optimizations and efficiency and the 2 things mentioned above are the absolute gems. Also, I highly recommend: https://medium.com/vunamhung/set-a-blazingly-fast-keyboard-r...
`0` is a little to fast for me so I prefer speed `1` and it's perfect.