Your .tmux.conf, a new prefix, key bindings, status line, vi keys.
Write a tmux.conf you actually understand: set options, rebind the prefix, add your own key bindings, and style the status line.
11 tasks · about 52 minutes · 26 key bindings
Start with task 1- 01
Show, set and unset options
4 minRead option values of each type, set a server option and a session option, watch renumbering happen, and unset one back to its default.
:show -g option:set -g option value:set -gu option - 02
Write the configuration file
4 minCreate ~/.tmux.conf, load it into the running server, then restart the server to see it load by itself.
:echo 'set -g mouse on' >> ~/.tmux.conf:source ~/.tmux.conf - 03
Add and remove key bindings
5 minBind a key to jump to window 10, bind two keys to split panes, bind a key that skips the prefix, then remove a binding.
:bind M-0 selectw -t:=10:bind -n M-n next-window:unbind M-0 - 04
Change the prefix key
4 minMove the prefix to C-a in the configuration file, unbind C-b, and make C-a C-a send the key through.
:set -g prefix C-a:bind C-a send-prefix - 05
Customize the status line
4 minMove the status line to the top, colour it, and simplify the right side to the time.
:set -g status-position top:set -g status-style bg=red:set -g status-right '%H:%M' - 06
Formats and embedded styles
4 minRebuild status-left with a format variable, an embedded style and a conditional that lights up when the prefix is pressed.
:set -g status-left '#{session_name}':#[fg=red]:set -g status-left-length 40 - 07
Embedded shell commands
3 minShow the output of a shell command in the status line and control how often it refreshes.
:set -g status-right '#(cmd)':set -g status-interval 5 - 08
Configure the pane border
4 minColour the pane borders, highlight the active one, and give every pane a bold title bar.
:set -g pane-border-style fg=red:set -g pane-active-border-style 'fg=red,bg=yellow':set -g pane-border-status top - 09
Use vi keys in copy mode
4 minSwitch copy mode and the prompt to vi keys, rebind v to start a selection, and copy a line the vi way.
:set -g mode-keys vi:bind -T copy-mode-vi v send -X begin-selectionEnter - 10
Mouse copying behaviour
4 minChange what happens when a mouse drag ends so the selection stays visible after it is copied.
:bind -Tcopy-mode MouseDragEnd1Pane send -X copy-selection-no-clear:unbind -Tcopy-mode MouseDragEnd1Pane - 11
Challenge: write your own tmux.conf
challenge12 minAuthor a complete configuration file from scratch and prove it loads on a freshly started server.