I still don't understand how this happened to so many people. Ctrl+a is already taken, how did anyone ever use screen without immediately changing it to something that doesn't conflict with a frequently used shell shortcut?
I still don't understand how this happened to so many people. Ctrl+a is already taken, how did anyone ever use screen without immediately changing it to something that doesn't conflict with a frequently used shell shortcut?
Zsh doesn't use readline (it has it's own line editor) but it can be set to vi-style input too. (Actually, at least on my system, bash doesn't seem to be linked with libreadline.. I'm not sure if it is actually using readline or not)
Of course, when I started developing on a Macbook, screen rapidly became problematic as there was no Home key and I started using Ctrl-A. For the moment, I'm developing locally so I don't need screen or tmux, but I'm working on off-loading to a VM and I'll be using tmux there for the purposes of maintaining my own sanity.
Control-q: beginning-of-line
I know, I know, now we are remapping all over the place. But my muscle memory for Ctrl-a was too ingrained after years of screen usage.So if I want to go to the beginning of a line in Bash, I just press C-a C-a (which actually works if I hold down Ctrl and press 'a' twice.
Not a big deal at all, and since I remap Caps Lock to Ctrl, the command combo is right on my left hand. (I slide my hand over a bit as if I were playing guitar or piano, rather than stretch fingers, so pinky on CapsLock, ring finger on a.)
The guy introduced me to screen recommended it. His words were "if you're an emacs guy, having this mapped to ctrl-a is going to drive you crazy"
Such a handy feature, isn't it. I would be lost without my drop-down console.
You can send it to ping on linux to print a report line without terminating, for example.
ctrl-b is fairly quick and easy if you use two hands (which is inferior to using one hand) and is quite a bit more difficult than ctrl-a when using one hand.
# C-z as prefix key. C-z C-z will send C-z to application, C-z z cycles last window
set-option -g prefix C-z
unbind C-b
bind-key C-z send-prefix
bind-key z last-windowIt is a minor annoyance in markdown but in shell programming I use `$(...)` instead, since it can be hard to tell if a character is a backtick or a single quote.