Tmux configuration: Difference between revisions

From wikinotes
Line 66: Line 66:
Keys are bound within tables. by default, they are bound to the <code>prefix</code> table (active following tmux-prefix activation).<br>
Keys are bound within tables. by default, they are bound to the <code>prefix</code> table (active following tmux-prefix activation).<br>
See [https://man.archlinux.org/man/community/tmux/tmux.1.en#KEY_BINDINGS KEYBINDINGS] section in man page.
See [https://man.archlinux.org/man/community/tmux/tmux.1.en#KEY_BINDINGS KEYBINDINGS] section in man page.
<code>bind</code> and <code>bind-key</code> can be used interchangeably.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
Line 76: Line 78:
   ${TMUX_COMMAND} ${ARGUMENTS[@]}
   ${TMUX_COMMAND} ${ARGUMENTS[@]}
</syntaxhighlight>
</syntaxhighlight>
<code>bind</code> and <code>bind-key</code> can be used interchangeably.


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">

Revision as of 16:49, 18 September 2021

Documentation

keybindings https://man.archlinux.org/man/community/tmux/tmux.1.en#KEY_BINDINGS
mouse https://man.archlinux.org/man/community/tmux/tmux.1.en#MOUSE_SUPPORT

Locations

~/.tmux.conf config

Commands

notifications

set -g display-time 5000                     # message display duration
display-message -c /dev/pts/0 'hello world'  # show a message

terminal

set -g default-terminal "screen-256color"  # desired $TERM value
set -g visual-bell off
set -g visual-activity off
set -g bell-action current

mouse

set -g mouse on

statusbar

set -g pane-base-index 1
set -g status-position top
setw -g clock-mode-style 2

source-file

source-file ${FILE}  # import file

keybindings

Keys are bound within tables. by default, they are bound to the prefix table (active following tmux-prefix activation).
See KEYBINDINGS section in man page.

bind and bind-key can be used interchangeably.

tmux bind-key \
  [-n] `# bind w/o prefix (root table)` \
  [-r] `# repeatable` \
  [-N ${NOTE}] \
  [-T ${KEY_TABLE}] \
  ${KEY} \
  ${TMUX_COMMAND} ${ARGUMENTS[@]}
bind-key     F1   set-option status off  # bind key-sequence
bind-key -n  M-0  select-window -t 10    # bind key-sequence to root table (no prefix reqd)

unbind C-b                               # unbind key-sequence

tmux prefix

set -g prefix 'M-a'                      # set (additional) alternative tmux-prefix

vi mode

set -g mode-keys vi
set -g status-keys vi