-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathtmux-cheatsheet.tex
140 lines (134 loc) · 5.33 KB
/
tmux-cheatsheet.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
\documentclass[landscape]{article}
\usepackage[letterpaper,landscape,margin=1.5cm]{geometry}
\usepackage[table]{xcolor}
\usepackage{dejavu}
\renewcommand*\familydefault{\sfdefault}
\usepackage[T1]{fontenc}
\usepackage{multicol}
\newcommand{\thead}[1]{{\color{black}\bf#1}}
% Tables are colored via xcolor package. The following command can be
% used at the beginning of a table to ensure that the colors start on
% the right foot.
\newcommand{\blankfirst}{%
\ifodd\rownum\advance\rownum1\relax\fi}
\newcommand{\coloredfirst}{%
\blankfirst\advance\rownum1\relax}
\begin{document}
\thispagestyle{empty}
\rowcolors{2}{white}{blue!35}
\begin{center}
\Huge \texttt{tmux} cheat sheet%
\rlap{\color{blue!50}\large{v1.0}}%
\llap{\raisebox{-1ex}{%
\normalsize\color{gray}http://www.clintoncurry.net/tmux-cheatsheet}}
\end{center}
\begin{multicols}{3}
\small
\section*{Sessions}
\blankfirst
\noindent\begin{tabular}{p{0.6in}p{2.3in}} % tblfmt
\thead{Key} & \thead{Function}\\
\verb|$| & Rename the session.\\
\verb|s| & Go to a window in a different session.\\
\verb|L| & Switch to the last session.\\
\verb|(| or \verb|)| & Cycle through sessions.\\
\verb|r| & Refresh the client.\\
\verb|d| & Detach yourself from the session.\\
\verb|D| & Detach someone else from the session.\\
\end{tabular}
\section*{Misc}
\blankfirst
\noindent\begin{tabular}{p{0.6in}p{2.3in}} % tblfmt
\thead{Key} & \thead{Function}\\
\verb|C-b| & Send the prefix on through to the current pane's process.\\
\verb|C-z| & Sends the tmux process to the background.\\
\verb|:| & Enter a command directly.\\
\verb|?| & Show a list of all key bindings.\\
%\texttt{{\raise.17ex\hbox{$\scriptstyle\sim$}}}
$\mathtt \sim$ & Show tmux messages you might have missed.\\
\verb|t| & Show a clock in the current pane\\
\verb|i| & Displays information about the current window\\
\end{tabular}
\section*{Copy/Paste (Emacs mode)}
See man page for vi mode commands.\\
\blankfirst
\noindent\begin{tabular}{p{0.6in}p{2.3in}} % tblfmt
\thead{Key} & \thead{Function}\\
\verb|[| & Enter copy mode\\
C-Spc & Start selection\\
C-w & Copy selection\\
\verb|v| or \verb|R| & Toggle rectangle select\\
\verb|#| & Past buffer select menu\\
\verb|]| & Paste into the current buffer.\\
\verb|-| & Delete the current buffer\\
PgUp & Enter copy mode, and scroll up.\\
\end{tabular}
\section*{Panes}
\subsection*{\color{gray!80}Pane navigation and management}
\blankfirst
\noindent\begin{tabular}{p{0.6in}p{2.3in}} % tblfmt
\thead{Key} & \thead{Function}\\
\verb|o| & Select the next pane\\
\verb|"| & Splits the area occupied by the current pane into two panes.\\
\verb|%| & Splits the area occupied by the current pane into two panes.\\
Arrows & Move to pane in that direction\\
\verb|C-o| & Rotates the panes around in the current window\\
\verb|!| & Creates a new window and moves the current pane there.\\
\verb|q| & Briefly label the panes with their numbers and dimensions\\
\verb|x| & Kill the current pane\\
\verb|{| & Swap this pane with the previous one\\
\verb|}| & Swap this pane with the next one\\
\end{tabular}
\subsection*{\color{gray!80}Pane layout}
\blankfirst
\noindent\begin{tabular}{p{0.6in}p{2.3in}} % tblfmt
\thead{Key} & \thead{Function}\\
\verb|M-1| & even-horizontal\\
\verb|M-2| & even-vertical\\
\verb|M-3| & main-horizontal\\
\verb|M-4| & main-vertical\\
\verb|M-5| & tiled\\
Spc & Cycles through the above arrangements.\\
\verb|C-|arrow & Resize a pane (slowly)\\
\verb|M-|arrow & Resize a pane (quickly)\\
\verb|u| & Go backward in this window's layout history (repeatable)\\
\verb|U| & Go forward in this window's layout history (repeatable)\\
\end{tabular}
\columnbreak
\section*{Windows}
\blankfirst
\noindent\begin{tabular}{p{0.6in}p{2.3in}} % tblfmt\noindent\begin{tabular}{p{.4in}p{0.9in}p{1.5in}} % tblfmt
\thead{Key} & \thead{Function}\\
\verb|c| & Create a new window\\
0\dots9 & Choose window 0, 1, \dots, 9.\\
\verb|'| & Select a window (prompt for index)\\
\verb|.| & Give the current window a new index\\
\verb|f| & Finds a window whose title matches the selected glob.\\
\verb|,| & Rename the current window\\
\verb|&| & Kill the current window.\\
\verb|M-n| & next window that has seen activity\\
\verb|M-p| & previous window that has seen activity\\
\verb|l| & Go to the last window\\
\verb|n| & Go to the next window\\
\verb|p| & Go to the previous window\\
\verb|w| & Choose a window from an interactive list.\\
\end{tabular}
\section*{On the command line}
\ifodd\rownum\advance\rownum1\relax\fi
\coloredfirst
\begin{tabular}{p{2.9in}}
\verb|tmux new-session -s session-name|\\
\verb|tmux list-sessions|\\
\verb|tmux kill-session -t target|
\end{tabular}
\section*{Tips}
\begin{itemize}
\item The default prefix is \verb|C-b|. Some folks change it to \verb|C-a|, but don't you use that one?
\item After \verb|C-b ?|, use \verb|/| to search for a command;
\verb|n| and \verb|N| to navigate among results.
\item Many folks can attach to the same session.
\item Highly configurable. Check the man page.
\item Some keys can be repeated without prefixing again.
\end{itemize}
\end{multicols}
\end{document}