summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/tmux.1
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2015-04-20 15:34:57 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2015-04-20 15:34:57 +0000
commitdb5f57524393156f08978dd652e4c27ce7b7a0d8 (patch)
tree49c7da9c4ae29d711d91ff60b91904b6b685a0b2 /usr.bin/tmux/tmux.1
parent4d13a2b4c2db7e15f0d3ff9f2131319db45a9bdc (diff)
Support for multiple key tables to commands to be bound to sequences of
keys. The default key bindings become the "prefix" table and -n the "root" table. Keys may be bound in new tables with bind -T and switch-client -T used to specify the table in which the next key should be looked up. Based on a diff from Keith Amling.
Diffstat (limited to 'usr.bin/tmux/tmux.1')
-rw-r--r--usr.bin/tmux/tmux.1110
1 files changed, 77 insertions, 33 deletions
diff --git a/usr.bin/tmux/tmux.1 b/usr.bin/tmux/tmux.1
index b6fe3b8b9fd..108479eccb1 100644
--- a/usr.bin/tmux/tmux.1
+++ b/usr.bin/tmux/tmux.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tmux.1,v 1.420 2015/04/19 22:10:30 jmc Exp $
+.\" $OpenBSD: tmux.1,v 1.421 2015/04/20 15:34:56 nicm Exp $
.\"
.\" Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
.\"
@@ -14,7 +14,7 @@
.\" IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
.\" OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 19 2015 $
+.Dd $Mdocdate: April 20 2015 $
.Dt TMUX 1
.Os
.Sh NAME
@@ -838,6 +838,7 @@ Suspend a client by sending
.Op Fl lnpr
.Op Fl c Ar target-client
.Op Fl t Ar target-session
+.Op Fl T Ar key-table
.Xc
.D1 (alias: Ic switchc )
Switch the current session for client
@@ -855,6 +856,22 @@ respectively.
toggles whether a client is read-only (see the
.Ic attach-session
command).
+.Pp
+.Fl T
+sets the client's key table; the next key from the client will be interpreted from
+.Ar key-table .
+This may be used to configure multiple prefix keys, or to bind commands to
+sequences of keys.
+For example, to make typing
+.Ql abc
+run the
+.Ic list-keys
+command:
+.Bd -literal -offset indent
+bind-key -Ttable2 c list-keys
+bind-key -Ttable1 b switch-client -Ttable2
+bind-key -Troot a switch-client -Ttable1
+.Ed
.El
.Sh WINDOWS AND PANES
A
@@ -1931,6 +1948,7 @@ Commands related to key bindings are as follows:
.It Xo Ic bind-key
.Op Fl cnr
.Op Fl t Ar mode-table
+.Op Fl T Ar key-table
.Ar key Ar command Op Ar arguments
.Xc
.D1 (alias: Ic bind )
@@ -1938,16 +1956,40 @@ Bind key
.Ar key
to
.Ar command .
-By default (without
-.Fl t )
-the primary key bindings are modified (those normally activated with the prefix
-key); in this case, if
-.Fl n
-is specified, it is not necessary to use the prefix key,
-.Ar command
+Keys are bound in a key table.
+By default (without -T), the key is bound in
+the
+.Em prefix
+key table.
+This table is used for keys pressed after the prefix key (for example,
+by default
+.Ql c
is bound to
-.Ar key
-alone.
+.Ic new-window
+in the
+.Em prefix
+table, so
+.Ql C-b c
+creates a new window).
+The
+.Em root
+table is used for keys pressed without the prefix key: binding
+.Ql c
+to
+.Ic new-window
+in the
+.Em root
+table (not recommended) means a plain
+.Ql c
+will create a new window.
+.Fl n
+is an alias
+for
+.Fl T Ar root .
+Keys may also be bound in custom key tables and the
+.Ic switch-client
+.Fl T
+command used to switch to them from a key binding.
The
.Fl r
flag indicates this key may repeat, see the
@@ -1962,22 +2004,33 @@ is bound in
.Ar mode-table :
the binding for command mode with
.Fl c
-or for normal mode without.
+or for normal mode without. See the
+.Sx WINDOWS AND PANES
+section and the
+.Ic list-keys
+command for information on mode key bindings.
+.Pp
To view the default bindings and possible commands, see the
.Ic list-keys
command.
-.It Ic list-keys Op Fl t Ar key-table
+.It Xo Ic list-keys
+.Op Fl t Ar mode-table
+.Op Fl T Ar key-table
+.Xc
.D1 (alias: Ic lsk )
List all key bindings.
Without
-.Fl t
-the primary key bindings - those executed when preceded by the prefix key -
-are printed.
+.Fl T
+all key tables are printed.
+With
+.Fl T
+only
+.Ar key-table .
.Pp
With
.Fl t ,
the key bindings in
-.Ar key-table
+.Ar mode-table
are listed; this may be one of:
.Em vi-edit ,
.Em emacs-edit ,
@@ -2022,31 +2075,22 @@ the secondary prefix key, to a window as if it was pressed.
.It Xo Ic unbind-key
.Op Fl acn
.Op Fl t Ar mode-table
+.Op Fl T Ar key-table
.Ar key
.Xc
.D1 (alias: Ic unbind )
Unbind the command bound to
.Ar key .
-Without
+.Fl c ,
+.Fl n ,
+.Fl T
+and
.Fl t
-the primary key bindings are modified; in this case, if
-.Fl n
-is specified, the command bound to
-.Ar key
-without a prefix (if any) is removed.
+are the same as for
+.Ic bind-key .
If
.Fl a
is present, all key bindings are removed.
-.Pp
-If
-.Fl t
-is present,
-.Ar key
-in
-.Ar mode-table
-is unbound: the binding for command mode with
-.Fl c
-or for normal mode without.
.El
.Sh OPTIONS
The appearance and behaviour of