I was trying to learn how to use the bind-key [-cnr] [-t key-table] key command [arguments]
better, but was having some trouble figuring out what "valid keys" are for bind-key
command.
I tried doing man tmux
and Google too, but I couldn't find anything useful.
- How can I figure out what the syntax for valid keys are?
- Is there a help command or a
man
page for this? - Maybe I don't know the technical term for this valid keys, is there a term for these keys so that I can do a better google search?
For example, I was trying to figure out what the following remapping of commands meant:
bind-key -n M-S-Left resize-pane -L 2
bind-key -n M-S-Right resize-pane -R 2
bind-key -n M-S-Up resize-pane -U 2
bind-key -n M-S-Down resize-pane -D 4
The -n
was easy to find in the man
page (doesn't need prefix). But I can't figure out what M-S-Left
key means.
I am guessing that its mapping shift and the left arrow plus whatever M
means to the resize-pane -L 2
command.
- How do I figure out what
M
means? - What if I wanted control + whatever key I wanted. Is control =
C
? - How can I figure this out without just trying random keys on my keyboard until something works?
- Also, how do I confirm, figure out if I am not mapping it to a key set that is already used?
- Is there such a thing as "show all aliases" or something?
- As an addition to the question, are these valid keys the same as the ones for
vim
?
The thing is that vim
seems to have a different scripting for its own language since it sometimes require and stuff.
Best Answer
Available Keys
Look at
man tmux
, search / forKEY BINDINGS
:M-S-Left should be Alt+Shift+Left for example.
List all bound keys
To list all key bindings, simply press Ctrl-b then ? while in a
tmux
session.This is also documented in
man tmux
in sectionEXAMPLES
:You can also list all key-bindings via
tmux list-keys
. If you want to check for already set keys, you cangrep
it's output to check, if it's already set.Research
To find more via Google, search for Section names in
man tmux
- just type intmux default key bindings
for example :). But oftenman tmux
is sufficient.This site is a very good documentation about
tmux
and pops up, if you search for said string in Google.Arch wiki is always good, too.