\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{spmc} \pdfinfo{ /Title (spacemacs-clojure.pdf) /Creator (Cheatography) /Author (spmc) /Subject (Spacemacs (+Clojure) 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}{12A308} \definecolor{LightBackground}{HTML}{F7FCF7} \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{Spacemacs (+Clojure) Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{spmc} via \textcolor{DarkBackground}{\uline{cheatography.com/29492/cs/8659/}}} \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}spmc \\ \uline{cheatography.com/spmc} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 24th July, 2016.\\ Updated 24th July, 2016.\\ 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*}{3} \begin{tabularx}{5.377cm}{x{2.58804 cm} x{2.38896 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Navigation}} \tn % Row 0 \SetRowColor{LightBackground} Up & k \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Down & j \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Left & h \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Right & l \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} Down a page & Ctrl-d \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} Up a page & Ctrl-u \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} Up to next paragraph & \{ \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} Down to next paragraph & \} \tn % Row Count 9 (+ 2) % Row 8 \SetRowColor{LightBackground} Previous function & {[}{[} \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} Next function & {]}{]} \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} Up to outer brace & {[}\{ \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} Down to outer brace & {]}\} \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} Right a word & w \tn % Row Count 14 (+ 1) % Row 13 \SetRowColor{white} Left a word & b \tn % Row Count 15 (+ 1) % Row 14 \SetRowColor{LightBackground} Beginning of File & gg \tn % Row Count 16 (+ 1) % Row 15 \SetRowColor{white} End of File & G \tn % Row Count 17 (+ 1) % Row 16 \SetRowColor{LightBackground} End of line & \$ \tn % Row Count 18 (+ 1) % Row 17 \SetRowColor{white} First non-whitespace char of line & \textasciicircum{} \tn % Row Count 20 (+ 2) % Row 18 \SetRowColor{LightBackground} Jump to any word & SPC-SPC \textless{}first letter of word\textgreater{} \tn % Row Count 22 (+ 2) % Row 19 \SetRowColor{white} Jump back & Ctrl-o \tn % Row Count 23 (+ 1) % Row 20 \SetRowColor{LightBackground} Center buffer & zz \tn % Row Count 24 (+ 1) % Row 21 \SetRowColor{white} Last place you edited & g; \tn % Row Count 26 (+ 2) % Row 22 \SetRowColor{LightBackground} Last file path under your cursor & gf \tn % Row Count 28 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{You can use number+function for most, e.g. 5-w = 5 words right} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.88206 cm} x{1.09494 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Files}} \tn % Row 0 \SetRowColor{LightBackground} Open a file & SPC-f-f \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Save a file & SPC-f-s \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Create a file & SPC-f-f \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Find a file in your project & SPC-p-f \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} Edit .spacemacs & \seqsplit{SPC-f-e-d} \tn % Row Count 6 (+ 2) % Row 5 \SetRowColor{white} Switch to a file recently opened & SPC-b-b \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} Switch to last buffer & SPC-TAB \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} Toggle NeoTree & SPC-f-t \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.93183 cm} x{1.04517 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Editor}} \tn % Row 0 \SetRowColor{LightBackground} Quit & SPC-q-q \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Restart & SPC-q-r \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Increase/decrease font size & SPC-z-x \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Toggle line numbers & SPC-t-n \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} Toggle auto completion & SPC-t-a \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.23965 cm} x{2.73735 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Window Layouts}} \tn % Row 0 \SetRowColor{LightBackground} Split window vertically & SPC-w-v \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Split window horizontally & SPC-w-s \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Switch window & SPC-\textless{}nr. of window\textgreater{} \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} Switch window (alternative) & SPC-w-h (left), SPC-w-j (down)... \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} Show/hide layout help & SPC-l-? \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} Create a named layout & SPC-l-l \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} Save a layout by name & SPC-l-S \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} Switch to layout & SPC-l-\textless{}nr. of layout\textgreater{} \tn % Row Count 14 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Editing}} \tn % Row 0 \SetRowColor{LightBackground} Enter highlighting mode & v \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Undo & u \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} Redo & Ctrl-r \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} Comment out a line & g-c-c \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} Comment out highlighted text & g-c \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} Copy \textasciicircum{}1\textasciicircum{} & y \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} Paste & p \tn % Row Count 9 (+ 1) % Row 7 \SetRowColor{white} Paste above & P \tn % Row Count 10 (+ 1) % Row 8 \SetRowColor{LightBackground} Copy/Paste to/from register & "-a-y (yank in to register a), "-a-p \tn % Row Count 12 (+ 2) % Row 9 \SetRowColor{white} Delete \textasciicircum{}1\textasciicircum{} & d \tn % Row Count 13 (+ 1) % Row 10 \SetRowColor{LightBackground} Delete char & x \tn % Row Count 14 (+ 1) % Row 11 \SetRowColor{white} Delete until right parenteses & d-f-) \tn % Row Count 16 (+ 2) % Row 12 \SetRowColor{LightBackground} Replace mode & R \tn % Row Count 17 (+ 1) % Row 13 \SetRowColor{white} Replace char & r \tn % Row Count 18 (+ 1) % Row 14 \SetRowColor{LightBackground} Change\textasciicircum{}1\textasciicircum{} & c \tn % Row Count 19 (+ 1) % Row 15 \SetRowColor{white} Change everything between quotes & c-i-" \tn % Row Count 21 (+ 2) % Row 16 \SetRowColor{LightBackground} Show previous things you've copied & SPC-r-y \tn % Row Count 23 (+ 2) % Row 17 \SetRowColor{white} Indent hightlighted text & \textgreater{} and \textless{} (you can use 2\textgreater{},3\textless{}...) \tn % Row Count 25 (+ 2) % Row 18 \SetRowColor{LightBackground} Join lines separated by whitespace & J \tn % Row Count 27 (+ 2) % Row 19 \SetRowColor{white} Show whitespace & SPC-t-w \tn % Row Count 28 (+ 1) % Row 20 \SetRowColor{LightBackground} Convert spaces to tabs & SPC-:-tabify \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.43873 cm} x{2.53827 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Editing (cont)}} \tn % Row 21 \SetRowColor{LightBackground} Convert tabs to spaces & SPC-:-untabify \tn % Row Count 2 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{[}1{]}: You can use certain commands with additional options: dd = delete line, 5yy = yank 5 lines, dw = delete word, y\$ = yank until end of line...} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.4885 cm} x{2.4885 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Find Text}} \tn % Row 0 \SetRowColor{LightBackground} Find text in buffer & /-\textless{}text to search\textgreater{}-Enter (n for next result, N for previous) \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} Find next instance of a word that your cursor is over & * \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} Find previous instance of a word that your cursor is over & \# \tn % Row Count 9 (+ 3) % Row 3 \SetRowColor{white} Turn off previous search highlighting & :nohl-Enter \tn % Row Count 11 (+ 2) % Row 4 \SetRowColor{LightBackground} Find text in project & SPC-/ \tn % Row Count 12 (+ 1) % Row 5 \SetRowColor{white} Find test under curser in Project & SPC-* \tn % Row Count 14 (+ 2) % Row 6 \SetRowColor{LightBackground} Resume last search & SPC-s-l \tn % Row Count 15 (+ 1) % Row 7 \SetRowColor{white} Find and replace text in buffer, from current line & :.,\$s/\textless{}find text\textgreater{}/\textless{}replace text\textgreater{}/gc \tn % Row Count 18 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.33919 cm} x{2.63781 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Clojure}} \tn % Row 0 \SetRowColor{LightBackground} Start REPL (cider-jack-in) & SPC-m-s-i (use I for clojurescript) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Switch to REPL & SPC-m-s-s \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} Send and eval buffer in REPL & SPC-m-s-b \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} Send and eval last sexp in REPL & SPC-m-s-e \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} Send and eval function in REPL & SPC-m-s-f \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} Send and eval ns form in REPL & SPC-m-s-n \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} Send and eval region in REPL & SPC-m-s-r \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} Kill REPL & SPC-m-s-q \tn % Row Count 14 (+ 1) % Row 8 \SetRowColor{LightBackground} Cider grimoire & SPC-m-h-g \tn % Row Count 15 (+ 1) % Row 9 \SetRowColor{white} Cider doc & SPC-m-h-h \tn % Row Count 16 (+ 1) % Row 10 \SetRowColor{LightBackground} Cider javadoc & SPC-m-h-j \tn % Row Count 17 (+ 1) % Row 11 \SetRowColor{white} Eval buffer,last sexp,... & SPC-m-e-b, ... \tn % Row Count 19 (+ 2) % Row 12 \SetRowColor{LightBackground} Goto & SPC-m-g-\textless{}function\textgreater{} \tn % Row Count 20 (+ 1) % Row 13 \SetRowColor{white} Run all tests in ns & SPC-m-t-a \tn % Row Count 22 (+ 2) % Row 14 \SetRowColor{LightBackground} Re-run test failures for ns & SPC-m-t-r \tn % Row Count 24 (+ 2) % Row 15 \SetRowColor{white} Run test at point & SPC-m-t-t \tn % Row Count 25 (+ 1) % Row 16 \SetRowColor{LightBackground} Reload ns & SPC-m-d-r \tn % Row Count 26 (+ 1) % Row 17 \SetRowColor{white} Instrument expression & SPC-m-d-b \tn % Row Count 28 (+ 2) % Row 18 \SetRowColor{LightBackground} Display last stacktrace & SPC-m-d-e \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.33919 cm} x{2.63781 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Clojure (cont)}} \tn % Row 19 \SetRowColor{LightBackground} Inspect expression & SPC-m-d-i \tn % Row Count 1 (+ 1) % Row 20 \SetRowColor{white} Realign current form & SPC-m-f-l \tn % Row Count 3 (+ 2) % Row 21 \SetRowColor{LightBackground} Reformat current buffer & SPC-m-f-b \tn % Row Count 5 (+ 2) % Row 22 \SetRowColor{white} {\bf{Refactoring}} & SPC-m-r-\textless{}function\textgreater{} \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}