\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{Daniel Doherty (ddoherty03)} \pdfinfo{ /Title (mu4e-with-gmail-hints.pdf) /Creator (Cheatography) /Author (Daniel Doherty (ddoherty03)) /Subject (mu4e (With GMail Hints) Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{AFD8E0} \definecolor{LightBackground}{HTML}{F5FAFB} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{mu4e (With GMail Hints) Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Daniel Doherty (ddoherty03)} via \textcolor{DarkBackground}{\uline{cheatography.com/63303/cs/22040/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}Daniel Doherty (ddoherty03) \\ \uline{cheatography.com/ddoherty03} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 12th March, 2021.\\ Updated 13th May, 2021.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{2} \begin{tabularx}{8.4cm}{x{1.36 cm} x{6.64 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Main View}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{j}} & Jump to maildir folder \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{s}} & Enter a mu find search string (see below) \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{C}} & Compose a new email \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{b}}{\emph{x}} & Run bookmark {\emph{x}} \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{;}} & Switch context \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} {\bf{U}} & Update email and mu database \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{q}} & Quit mu4e \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.88 cm} x{5.12 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Movement}} \tn % Row 0 \SetRowColor{LightBackground} & {\bf{Header and Message View}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{n,p}} & Move to next, prior \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{{]},{[}}} & Move to next, prior unread \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\bf{y}} & Move between header and message view \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{q}} & Leave view \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} & {\bf{Header View}} \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{`RET`}} & Open message at point \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} & {\bf{Message View}} \tn % Row Count 11 (+ 1) % Row 8 \SetRowColor{LightBackground} {\bf{`PgDn,RET`,`SPC`}} & Scroll down \tn % Row Count 13 (+ 2) % Row 9 \SetRowColor{white} {\bf{`PgUp,S-SPC`}} & Scroll up \tn % Row Count 15 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{`M-RET`}} & Open attachment or URL at point \tn % Row Count 17 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.24 cm} x{5.76 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Searching}} \tn % Row 0 \SetRowColor{LightBackground} & {\bf{Header and Message View}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{s}} & Enter new search string \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{/}} & Narrow search within current result set \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} {\bf{b}} & Run a bookmark search \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{B}} & Edit a new search based on a bookmark \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} {\bf{j}} & Jump to a maildir \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{M-\textless{}left\textgreater{},\textbackslash{} }} & Widen, go back in search history \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} {\bf{M-\textless{}right\textgreater{}}} & Go forward in search history \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} & {\bf{Header View}} \tn % Row Count 13 (+ 1) % Row 9 \SetRowColor{white} {\bf{S}} & Edit current search string \tn % Row Count 14 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{O}} & Change sort order of headers \tn % Row Count 15 (+ 1) % Row 11 \SetRowColor{white} {\bf{P}} & Toggle threading of message headers \tn % Row Count 17 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{Q}} & Toggle full search \tn % Row Count 18 (+ 1) % Row 13 \SetRowColor{white} {\bf{V}} & Toggle skipping duplicates \tn % Row Count 19 (+ 1) % Row 14 \SetRowColor{LightBackground} {\bf{W}} & Toggle including related \tn % Row Count 20 (+ 1) % Row 15 \SetRowColor{white} & {\bf{Message View}} \tn % Row Count 21 (+ 1) % Row 16 \SetRowColor{LightBackground} {\bf{e}} & Edit current search string \tn % Row Count 22 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{2.32 cm} x{5.68 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Marking}} \tn % Row 0 \SetRowColor{LightBackground} & {\bf{Header and Message View}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{d}} & Mark for trashing \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{=}} & Mark for untrashing \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {\bf{D,`\textless{}DEL\textgreater{}`}} & Mark for deletion \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{m}} & Mark for movement to other maildir \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} {\bf{r}} & Mark for refiling \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{+/-}} & Flag/Unflag \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} {\bf{?,!}} & Mark message read/unread \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} {\bf{u}} & Unmark current message \tn % Row Count 11 (+ 1) % Row 9 \SetRowColor{white} {\bf{U}} & Unmark all messages \tn % Row Count 12 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{\%}} & Mark based on regex \tn % Row Count 13 (+ 1) % Row 11 \SetRowColor{white} {\bf{T,t}} & Mark whole thread/subthread \tn % Row Count 14 (+ 1) % Row 12 \SetRowColor{LightBackground} {\bf{*,`\textless{}INS\textgreater{}`}} & Mark for deferred action \tn % Row Count 16 (+ 2) % Row 13 \SetRowColor{white} {\bf{\#}} & Choose action for deferred marks \tn % Row Count 18 (+ 2) % Row 14 \SetRowColor{LightBackground} {\bf{x}} & Execute actions on marked messages \tn % Row Count 20 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{1.12 cm} x{6.88 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Composing}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{R}} & Reply to sender/all as prompted \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{F}} & Forward message to third party \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{C}} & Compose a new message \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {\bf{E}} & Edit a draft message \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{x{1.92 cm} x{6.08 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Other}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{;}} & Switch context \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{a}} & Perform custom action on message \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{|}} & Pipe message through shell command \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\bf{H}} & Get help \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{C-+,C-{}-}} & Increase/descrease headers shown \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} {\bf{C-S-u}} & Update and reindex \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{p{1.04 cm} x{6.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Message View}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{g}} & Visit the numbered URL in browser. Prompts for URL number. C-u prefix for multiple URLs. \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} {\bf{f}} & Fetch or download the numbered URL to directory given by `mu4e-attachment-dir`. C-u for multiple downloads. \tn % Row Count 7 (+ 4) % Row 2 \SetRowColor{LightBackground} {\bf{k}} & Save the numbered URLs to the kill ring. C-u to save multiple URLs. \tn % Row Count 9 (+ 2) % Row 3 \SetRowColor{white} {\bf{e}} & Extract numbered attachments to a directory, default `mu4e-attachment-dir`. Prompts for number, range or `a` for all. `S-RET` on attachment does same. \tn % Row Count 14 (+ 5) % Row 4 \SetRowColor{LightBackground} {\bf{o}} & Open numbered attachment. Prompts for number to open. `M-RET` on attachment does the same. \tn % Row Count 17 (+ 3) % Row 5 \SetRowColor{white} {\bf{a}} & Perform a custom action on the current message. \tn % Row Count 19 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{A}} & Perform a custom action on a numbered attachement. \tn % Row Count 21 (+ 2) % Row 7 \SetRowColor{white} {\bf{c}} & Copy the email address under the cursor. Use C-u to copy the long version with the person's name. \tn % Row Count 24 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{h}} & Toggle between text and HTML if email has both versions. \tn % Row Count 26 (+ 2) % Row 9 \SetRowColor{white} {\bf{w}} & Toggle visual-line-mode. If it makes lines too wide, consider installing `visual-fill-column` package. \tn % Row Count 30 (+ 4) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{p{1.04 cm} x{6.96 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{8.4cm}}{\bf\textcolor{white}{Message View (cont)}} \tn % Row 10 \SetRowColor{LightBackground} {\bf{\#}} & Toggle display of citations. \tn % Row Count 1 (+ 1) % Row 11 \SetRowColor{white} {\bf{v}} & View cryptographic signature details. \tn % Row Count 3 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{.}} & Show the raw message with all headers, etc. Use `q` to go back to the cooked view. \tn % Row Count 6 (+ 3) % Row 13 \SetRowColor{white} {\bf{C+}} & Increase the number of headers shown in a split header-message view. \tn % Row Count 8 (+ 2) % Row 14 \SetRowColor{LightBackground} {\bf{C-}} & Decrease the number of headers shown in a split header-message view. \tn % Row Count 10 (+ 2) % Row 15 \SetRowColor{white} {\bf{q}} & Leave message view. \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{8.4cm}}{mu4e uses the `xdg-open` program or the `open` (on OS X) program to opening attachments. Use another program by setting the environment variable `MU\_PLAY\_PROGRAM`.} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{GMail Hints}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{Label-Driven Email}} \newline % Row Count 1 (+ 1) Instead of organizing emails by maildirs, you can use GMail's all-label way of categorizing emails. GMail keeps all emails in one "maildir" called "{[}Gmail{]}/All Mail", which I have offlineimap map to a maildir called "Archive". You need only sync Archive and Trash. Rely on labels to formulate mu4e "bookmarks." Emails with the label: \newline % Row Count 8 (+ 7) - `\textbackslash{}Inbox` are what you see in your GMail inbox (all categories Primary, Social, etc.), \newline % Row Count 10 (+ 2) - `\textbackslash{}Spam` for what GMail considers spam, \newline % Row Count 11 (+ 1) - `\textbackslash{}Draft` for drafts emails, \newline % Row Count 12 (+ 1) - `\textbackslash{}Trash` deleted emails scheduled for purging per GMail settings, and \newline % Row Count 14 (+ 2) - `Whatever` your "folder names" are just labels of the same name (no leading backslash). Sub-folders are separated with a slash: `Business/Urgent`, for example. \newline % Row Count 18 (+ 4) {\bf{ Accessing GMail Categories}} \newline % Row Count 19 (+ 1) One of the difficulties of integrating mu4e with GMail, is getting access to the very helpful "Categories" assigned by GMail to incoming emails. There is nothing in the email header to indicate the category. You can fix this by creating a filter in GMail that applies a label to emails based on their categories. Add a filter with the following in the "Has the words field": category:(promotions), or category:(primary), etc. In the action, tell GMail to apply a label, such as "CatPromotions". Now, you can use the label in a mu4e search to handle Gmail categories as you like. For example, filter for unread inbox with "x:CategoryPrimary" as one of the selectors. \newline % Row Count 33 (+ 14) } \tn \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{8.4cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{8.4cm}}{\bf\textcolor{white}{GMail Hints (cont)}} \tn \SetRowColor{white} \mymulticolumn{1}{x{8.4cm}}{{\bf{ Example GMail Inbox Bookmark }} \newline % Row Count 1 (+ 1) (with-eval-after-load 'mu4e \newline % Row Count 2 (+ 1) ~~(setq mu4e-bookmarks \newline % Row Count 3 (+ 1) ~~~~`(,(make-mu4e-bookmark \newline % Row Count 4 (+ 1) ~~~~~~:name "Inbox" \newline % Row Count 5 (+ 1) ~~~~~~:query "x:\textbackslash{}\textbackslash{}\textbackslash{}\textbackslash{}Inbox and x:CatPrimary and m:/Archive and not g:list" \newline % Row Count 8 (+ 3) ~~~~~~:key ?i) \newline % Row Count 9 (+ 1) ~~~~,(make-mu4e-bookmark \newline % Row Count 10 (+ 1) ~~~~~~:name "Unread Inbox" \newline % Row Count 12 (+ 2) ~~~~~~:query "x:\textbackslash{}\textbackslash{}\textbackslash{}\textbackslash{}Inbox and x:CatPrimary and m:/Archive and g:unread and not g:list" \newline % Row Count 15 (+ 3) ~~~~~~:key ?I)% Row Count 16 (+ 1) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}