From d4fb6d0446df0432e7a77371bca3308db674dc75 Mon Sep 17 00:00:00 2001 From: srdusr Date: Wed, 30 Nov 2022 23:36:59 +0200 Subject: Add information about keys, commands and plugins #TODO: fix formatting of the text --- tools/tmux.md | 296 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) (limited to 'tools/tmux.md') diff --git a/tools/tmux.md b/tools/tmux.md index e69de29..2189e0a 100644 --- a/tools/tmux.md +++ b/tools/tmux.md @@ -0,0 +1,296 @@ +## Tmux Notes +#### Plugins +* Key bindings for tmux-resurrect +` + Ctrl-s` # save changed to 'W' +` + Ctrl-r` # restore changed to 'E' +* Installing plugins +` + I` +then reload tmux environment with either: +$ `tmux source ~/.tmux.conf` +or if tmux config is in a XDG config base directory +$ `tmux source ~/.config/tmux/tmux.conf` +* Plugin uninstall +Delete or comment out the plugin in .tmux.conf +Then save and reload +- - - +#### Basic commands/keys +* List keybindings +$ `tmux list-keys` +or +`:list-keys` +or +`:?` + +* Panes Management +`:swap-pane -U` # move current pane up or anti-clockwise +`:swap-pane -D` # move current pane down or clockwise +`{` or `(:swap-pane -L)` # move current pane to the left +`}` or `(:swap-pane -R)` # move current pane to the right +`q` # show pane numbers (type number to move cursor) +`` # toggle pane arrangements +`Ctrl-o` # rotate window + +* Move cursor to next window +`o` + +* Close Window +`&` or `:kill-window` # kill window +- - - +#### SESSIONS +* Start a new session +$ `tmux` +$ `tmux new` +$ `tmux new-session` +`:new` + +* Start a new session with the name ***mysession*** +$ `tmux new -s mysession` +`:new -s mysession` + +* Kill/delete session mysession +$ `tmux kill-ses -t mysession` +$ `tmux kill-session -t mysession` + +* Kill/delete all sessions but the current +$ `tmux kill-session -a` + +* Kill/delete all sessions but mysession +$ `tmux kill-session -a -t mysession` + +* Rename session +`$` + +* Detach from session +`d` + +* Detach others on the session (Maximize window by detaching other clients) +`:attach -d` + +* Show all sessions +$ `tmux ls` +$ `tmux list-sessions` +`s` + +* Attach to last session +$ `tmux a` +$ `tmux at` +$ `tmux attach` +$ `tmux attach-session` + +* Attach to a session with the name mysession +$ `tmux a -t mysession` +$ `tmux at -t mysession` +$ `tmux attach -t mysession` +$ `tmux attach-session -t mysession` + +* Move to previous session +`(` + +* Move to next session +`)` + +#### WINDOWS + +* Start a new session with the name mysession and window mywindow +$ tmux new -s mysession -n mywindow + +* Create window + c + +* Rename current window + , + +* Close current window + & + +* Previous window + p + +* Next window + n + +* Switch/select window by number + 0 ... 9 + +* Reorder window, swap window number 2(src) and 1(dst) +:swap-window -s 2 -t 1 + +* Move current window to the left by one position +:swap-window -t -1 + + + +* PANES + +* Toggle last active pane + ; + +* Split pane horizontally + % + +* Split pane vertically + " + +* Move the current pane left + { + +* Move the current pane right + } + +* Switch to pane to the direction + + + + + +* Toggle synchronize-panes(send command to all panes) +:setw synchronize-panes + +* Toggle between pane layouts + Spacebar + +* Switch to next pane + o + +* Show pane numbers + q + +* Switch/select pane by number + q 0 ... 9 + +* Toggle pane zoom + z + +* Convert pane into a window + ! + +* Resize current pane height(holding second key is optional) + + + Ctrl + + + + Ctrl + + +* Resize current pane width(holding second key is optional) + + + Ctrl + + + + Ctrl + + +* Close current pane + x + + + +* COPY MODE + +* Use vi keys in buffer +:setw -g mode-keys vi + +* Enter copy mode + [ + +* Enter copy mode and scroll one page up + PgUp + +* Quit mode + + +* Go to top line + + +* Go to bottom line + + +* Scroll up + + +* Scroll down + + +* Move cursor left + + +* Move cursor down + + +* Move cursor up + + +* Move cursor right + + +* Move cursor forward one word at a time + + +* Move cursor backward one word at a time + + +* Search forward + + +* Search backward + + +* Next keyword occurance + + +* Previous keyword occurance + + +* Start selection + + +* Clear selection + + +* Copy selection + + +* Paste contents of buffer_0 + ] + +* Display buffer_0 contents +:show-buffer + +* Copy entire visible contents of pane to a buffer +:capture-pane + +* Show all buffers +:list-buffers + +* Show all buffers and paste selected +:choose-buffer + +* Save buffer contents to buf.txt +:save-buffer buf.txt + +* Delete buffer_1 +:delete-buffer -b 1 + + + +* MISC + +* Enter command mode + : + +* Set OPTION for all sessions +:set -g OPTION + +* Set OPTION for all windows +:setw -g OPTION + +* Enable mouse mode +:set mouse on + + + +* HELP + +* List key bindings(shortcuts) +$ tmux list-keys +:list-keys + ? + +* Show every session, window, pane, etc... +$ tmux info -- cgit v1.2.3