Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

If I set key bind of C-b to c-a in tmux how can I move the cursor to the beginning of the line?

Tags:

tmux

I just move from GNU screen to tmux, in screen when I hit C-a, then type a again can take me to the beginning of the line, I wonder if I stick with C-a in tmux how can I work around this?

like image 776
mko Avatar asked Jul 19 '12 08:07

mko


People also ask

How do you use key bindings tmux?

tmux may be controlled from an attached client by using a key combination of a prefix key, 'C-b' (Ctrl-b) by default, followed by a command key. The default command key bindings are: C-b Send the prefix key (C-b) through to the application. C-o Rotate the panes in the current window forwards.

How do I change Ctrl B to tmux?

The first command unbind C-b removes the current Ctrl-b binding, the second command set-option -g prefix C-a set Ctrl-a as the main tmux command binding.

What is CB in tmux?

As you know, C-b is the default prefix in tmux . C-b C-b is used to send an actual C-b character to the terminal. If you switch the prefix to C-a , you just need to rebind some keys to update which one sends the send-prefix command.


2 Answers

As you know, C-b is the default prefix in tmux. C-b C-b is used to send an actual C-b character to the terminal. If you switch the prefix to C-a, you just need to rebind some keys to update which one sends the send-prefix command.

For your .tmux.conf:

# You probably already put this in
set prefix C-a

unbind-key C-b
bind-key C-a send-prefix
like image 198
chepner Avatar answered Oct 04 '22 01:10

chepner


Maybe its an issue about the version I am using, but if the above code does not work for you, try this:

set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
like image 39
user1978011 Avatar answered Oct 03 '22 01:10

user1978011