bind
and bind-key
are identical commands in tmux - they're just aliases of the same function. You can use either format interchangeably in your configuration. The shorter bind
is more commonly used due to brevity.
bind r source-file ~/.tmux.conf \; display "Reloaded!"
bind-key r source-file ~/.tmux.conf \; display "Reloaded!"
In tmux configuration, key bindings are defined using either the bind
or bind-key
command. These commands create shortcuts that combine the prefix key (typically Ctrl+b) with another key to execute a specific action.
bind
and bind-key
are functionally identical and can be used interchangeably. They are both aliases for the same internal command. This is similar to how set
and set-option
are equivalents, or setw
and set-window-option
.
# These do exactly the same thing - reload tmux config with 'prefix+r' bind r source-file ~/.tmux.conf \; display "Reloaded!" bind-key r source-file ~/.tmux.conf \; display "Reloaded!" # These also do the same thing - split window vertically with 'prefix+|' bind | split-window -h bind-key | split-window -h
To see all current key bindings in tmux, use:
Ctrl+b :list-keys
You'll notice that the output uses bind-key
in its display, but this doesn't mean that bind-key
is different or preferred over bind
.
Similarly, you can use either unbind
or unbind-key
to remove key bindings:
# These do the same thing - unbind the "l" key unbind l unbind-key l
For readability in your tmux.conf, consider picking either bind
or bind-key
and using it consistently throughout your configuration. Most users prefer bind
for its brevity, but it's purely a matter of personal preference.
In older versions of tmux documentation, you might see bind-key
used more frequently. Modern documentation and examples tend to use the shorter bind
form, but both remain fully supported.