Skip to content

Instantly share code, notes, and snippets.

@awwong1

awwong1/main.tex

Last active Mar 12, 2020
Embed
What would you like to do?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=20mm]{geometry}
\usepackage{tabularx} % table layout with line breaks
\usepackage{color} % custom grey color support
\usepackage{soul} % text highlighting support
\usepackage{hyperref} % URL link support
\definecolor{lightgrey}{rgb}{0.925, 0.925, 0.925}
\sethlcolor{lightgrey}
\newcommand*{\cbox}[1]{{\ttfamily\hl{#1}}}
\renewcommand{\arraystretch}{1.2} % Default value: 1
\def\tabularxcolumn#1{m{#1}} % Vertical aligns cells in table
\pagenumbering{gobble} % no page numbering
\begin{document}
\noindent
\begin{minipage}[t]{0.48\textwidth}
\begin{tabularx}{\textwidth}{XX}
\multicolumn{2}{l}{\textbf{Session Control (from the command line)}} \\ \hline
\cbox{tmux} & Start a new session \\
\cbox{tmux new -s \mbox{<session-name>}} & Start a new session with the name chosen \\
\cbox{tmux ls} & List all sessions \\
\cbox{tmux attach -t \mbox{<target-session>}} & Re-attach a detached session \\
\cbox{tmux attach -d -t \mbox{<target-session>}} & Re-attach a detached session (and detach it from elsewhere) \\
\cbox{tmux kill-session -t \mbox{<target-session>}} & Delete a session \\
\end{tabularx}
\vspace{1\baselineskip}
\begin{tabularx}{\textwidth}{lX}
\multicolumn{2}{l}{\textbf{Copy-Mode (vi)}} \\ \hline
\cbox{Ctrl} \cbox{b}, \cbox{[} & Enter copy mode \\
\cbox{Ctrl} \cbox{b}, \cbox{G} & Bottom of history \\
\cbox{Ctrl} \cbox{b}, \cbox{g} & Top of history \\
\cbox{Ctrl} \cbox{b}, \cbox{Enter} & Copy selection \\
\cbox{Ctrl} \cbox{b}, \cbox{p} & Paste selection \\
\cbox{Ctrl} \cbox{b}, \cbox{k} & Cursor Up \\
\cbox{Ctrl} \cbox{b}, \cbox{j} & Cursor Down \\
\cbox{Ctrl} \cbox{b}, \cbox{h} & Cursor Left \\
\cbox{Ctrl} \cbox{b}, \cbox{l} & Cursor Right \\
\end{tabularx}
\vspace{1\baselineskip}
\begin{tabularx}{\textwidth}{lX}
\multicolumn{2}{l}{\textbf{Copy-Mode (Emacs)}} \\ \hline
\cbox{Ctrl} \cbox{b}, \cbox{[} & Enter copy mode \\
\cbox{Ctrl} \cbox{b}, \cbox{M-<} & Bottom of history \\
\cbox{Ctrl} \cbox{b}, \cbox{M->} & Top of history \\
\cbox{Ctrl} \cbox{b}, \cbox{M-m} & Back to indentation \\
\cbox{Ctrl} \cbox{b}, \cbox{M-w} & Copy selection \\
\cbox{Ctrl} \cbox{b}, \cbox{M-y} & Paste selection \\
\cbox{Ctrl} \cbox{b}, \cbox{Ctrl} \cbox{g} & Clear selection \\
\cbox{Ctrl} \cbox{b}, \cbox{M-R} & Cursor to top line \\
\cbox{Ctrl} \cbox{b}, \cbox{M-r} & Cursor to middle line \\
\cbox{Ctrl} \cbox{b}, \cbox{$\uparrow$} & Cursor Up \\
\cbox{Ctrl} \cbox{b}, \cbox{$\downarrow$} & Cursor Down \\
\cbox{Ctrl} \cbox{b}, \cbox{$\leftarrow$} & Cursor Left \\
\cbox{Ctrl} \cbox{b}, \cbox{$\rightarrow$} & Cursor Right \\
\end{tabularx}
\end{minipage}
\hspace{0.04\textwidth}
\begin{minipage}[t]{0.48\textwidth}
\begin{tabularx}{\textwidth}{lX}
\multicolumn{2}{l}{\textbf{Window Control}} \\ \hline
\cbox{Ctrl} \cbox{b}, \cbox{c} & Create new window \\
\cbox{Ctrl} \cbox{b}, \cbox{d} & Detach from session \\
\cbox{Ctrl} \cbox{b}, \cbox{,} & Rename current window \\
\cbox{Ctrl} \cbox{b}, \cbox{\&} & Close current window \\
\cbox{Ctrl} \cbox{b}, \cbox{w} & List windows \\
\cbox{Ctrl} \cbox{b}, \cbox{p} & Previous window \\
\cbox{Ctrl} \cbox{b}, \cbox{n} & Next window \\
\end{tabularx}
\vspace{1\baselineskip}
\begin{tabularx}{\textwidth}{lX}
\multicolumn{2}{l}{\textbf{Pane Control}} \\ \hline
\cbox{Ctrl} \cbox{b}, \cbox{"} & Split pane horizontally \\
\cbox{Ctrl} \cbox{b}, \cbox{\%} & Split pane vertically \\
\cbox{Ctrl} \cbox{b}, \cbox{o} & Next pane \\
\cbox{Ctrl} \cbox{b}, \cbox{;} & Previous pane \\
\cbox{Ctrl} \cbox{b}, \cbox{q} & Show pane numbers \\
\cbox{Ctrl} \cbox{b}, \cbox{z} & Toggle pane zoom \\
\cbox{Ctrl} \cbox{b}, \cbox{!} & Convert pane into a window \\
\cbox{Ctrl} \cbox{b}, \cbox{x} & Kill current pane \\
\cbox{Ctrl} \cbox{b}, \cbox{Ctrl} \cbox{O} & Swap panes \\
\cbox{Ctrl} \cbox{b}, \cbox{t} & Display clock \\
\cbox{Ctrl} \cbox{b}, \cbox{q} & Transpose two letters (delete and paste) \\
\cbox{Ctrl} \cbox{b}, \cbox{\{} & Move to the previous pane \\
\cbox{Ctrl} \cbox{b}, \cbox{\}} & Move to the next pane \\
\cbox{Ctrl} \cbox{b}, \cbox{Space} & Toggle between pane layouts \\
\cbox{Ctrl} \cbox{b}, \cbox{$\uparrow$} & Resize pane (make taller) \\
\cbox{Ctrl} \cbox{b}, \cbox{$\downarrow$} & Resize pane (make smaller) \\
\cbox{Ctrl} \cbox{b}, \cbox{$\leftarrow$} & Resize pane (make wider) \\
\cbox{Ctrl} \cbox{b}, \cbox{$\rightarrow$} & Resize pane (make narrower) \\
\end{tabularx}
\vspace{1\baselineskip}
{A printable cheat sheet for \cbox{tmux} terminal multiplexer.
The complete list of options and commands are available at \href{https://man.openbsd.org/OpenBSD-current/man1/tmux.1}{https://man.openbsd.org/OpenBSD-current/man1/tmux.1}} or by running \cbox{man tmux}.
\end{minipage}%
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment