\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{MrCosta} \pdfinfo{ /Title (viminal.pdf) /Creator (Cheatography) /Author (MrCosta) /Subject (Viminal 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}{A3A3A3} \definecolor{LightBackground}{HTML}{F3F3F3} \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{Viminal Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{MrCosta} via \textcolor{DarkBackground}{\uline{cheatography.com/25709/cs/6915/}}} \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}MrCosta \\ \uline{cheatography.com/mrcosta} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 16th February, 2016.\\ Updated 20th February, 2017.\\ 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*}{4} \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Vim}} \tn % Row 0 \SetRowColor{LightBackground} \seqsplit{\%s/whatIsearch/whatIchange/g} & change and replace all occurrences \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} ctrl + p & search for file \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} shift + v & select \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} o & insert a new line in the EM \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} ctrl + v, shift + i (write what you want), esc + esc & column selection mode \tn % Row Count 9 (+ 3) % Row 5 \SetRowColor{white} x & delete character \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} A & EM in the end line \tn % Row Count 11 (+ 1) % Row 7 \SetRowColor{white} dw & delete word (need to be in the begin) \tn % Row Count 13 (+ 2) % Row 8 \SetRowColor{LightBackground} d\$ & delete from the CP until the EL \tn % Row Count 15 (+ 2) % Row 9 \SetRowColor{white} d0 & delete from the CP until the BL \tn % Row Count 17 (+ 2) % Row 10 \SetRowColor{LightBackground} d\textless{}amount\textgreater{}w & delete x words \tn % Row Count 18 (+ 1) % Row 11 \SetRowColor{white} dd & delete line \tn % Row Count 19 (+ 1) % Row 12 \SetRowColor{LightBackground} \textless{}amount\textgreater{}dd & delete x lines \tn % Row Count 20 (+ 1) % Row 13 \SetRowColor{white} u & undo \tn % Row Count 21 (+ 1) % Row 14 \SetRowColor{LightBackground} U & undo entire line \tn % Row Count 22 (+ 1) % Row 15 \SetRowColor{white} ctrl + r & redo \tn % Row Count 23 (+ 1) % Row 16 \SetRowColor{LightBackground} w & move between words \tn % Row Count 24 (+ 1) % Row 17 \SetRowColor{white} 0 & go to the begin of the line \tn % Row Count 26 (+ 2) % Row 18 \SetRowColor{LightBackground} \$ & go to the end of the line \tn % Row Count 28 (+ 2) % Row 19 \SetRowColor{white} dd + p & delete line and past below where you are \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.7165 cm} x{1.7165 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Vim (cont)}} \tn % Row 20 \SetRowColor{LightBackground} r\textless{}character\textgreater{} & replace the current char with the one that you type \tn % Row Count 3 (+ 3) % Row 21 \SetRowColor{white} Yp & copy and paste line \tn % Row Count 4 (+ 1) % Row 22 \SetRowColor{LightBackground} shift + g & go to the end of the file \tn % Row Count 6 (+ 2) % Row 23 \SetRowColor{white} I (izão) & begin of the line EM \tn % Row Count 7 (+ 1) % Row 24 \SetRowColor{LightBackground} put everything in upper case & select (with v) and press U \tn % Row Count 9 (+ 2) % Row 25 \SetRowColor{white} put everything in down case & select (with v) and press u \tn % Row Count 11 (+ 2) % Row 26 \SetRowColor{LightBackground} substitute word in a file & :s \tn % Row Count 13 (+ 2) % Row 27 \SetRowColor{white} do a macro & qa + yourcommands + q, and then @a to do it again \tn % Row Count 16 (+ 3) % Row 28 \SetRowColor{LightBackground} correct words or use shortcut & :abbr Lunix Linux \tn % Row Count 18 (+ 2) % Row 29 \SetRowColor{white} repeats the last command & . \tn % Row Count 20 (+ 2) % Row 30 \SetRowColor{LightBackground} delete to the end of the line & S \tn % Row Count 22 (+ 2) % Row 31 \SetRowColor{white} changes case & \textasciitilde{} \tn % Row Count 23 (+ 1) % Row 32 \SetRowColor{LightBackground} replace something in column mode & ctrl + v, c (write what you want), esc + esc \tn % Row Count 26 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{EM = edit mode \newline CP = current place \newline EL = end of the line \newline BL = begin of the line} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.51052 cm} x{1.92248 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{vim}} \tn % Row 0 \SetRowColor{LightBackground} ctrl + g & show information about the file \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} c\$ & delete the rest of the line and enter in IM \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} ce & delete the rest of the word and enter in IM \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} r\textless{}character\textgreater{} & replace the current caracter with what you type \tn % Row Count 9 (+ 3) % Row 4 \SetRowColor{LightBackground} \textless{}numberOfTheLine\textgreater{}G & back to the line you were \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} /\textless{}text\textgreater{} & search for the text after the place you are \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} n & go to the next occurrence \tn % Row Count 15 (+ 2) % Row 7 \SetRowColor{white} N & go to the previous occurrence \tn % Row Count 17 (+ 2) % Row 8 \SetRowColor{LightBackground} ?\textless{}text\textgreater{} & search for the text before the place you are \tn % Row Count 19 (+ 2) % Row 9 \SetRowColor{white} \% (on a brackets or parentheses) & go to the corresponding bracket/parentheses \tn % Row Count 21 (+ 2) % Row 10 \SetRowColor{LightBackground} :s/thee/the & change the first occurrence in the current line from thee to the \tn % Row Count 24 (+ 3) % Row 11 \SetRowColor{white} :s/thee/the/g & change all the occurrences in the current line from thee to the \tn % Row Count 27 (+ 3) % Row 12 \SetRowColor{LightBackground} :\%s/old/new/g & to change every occurrence in the whole file \tn % Row Count 29 (+ 2) % Row 13 \SetRowColor{white} :\%s/old/new/gc & to find every occurrence in the whole file, with a prompt whether to substitute or not. \tn % Row Count 35 (+ 6) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.51052 cm} x{1.92248 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{vim (cont)}} \tn % Row 14 \SetRowColor{LightBackground} gg & moves to the first line of the file \tn % Row Count 2 (+ 2) % Row 15 \SetRowColor{white} :!\textless{}terminalcommand\textgreater{} & execute and show the result of a terminal command \tn % Row Count 5 (+ 3) % Row 16 \SetRowColor{LightBackground} :w & save changes to the file \tn % Row Count 7 (+ 2) % Row 17 \SetRowColor{white} :w \textless{}nomeofthefile\textgreater{} & create the file with the name typed \tn % Row Count 9 (+ 2) % Row 18 \SetRowColor{LightBackground} o & create a new line in the IM below where you are \tn % Row Count 12 (+ 3) % Row 19 \SetRowColor{white} O & create a new line in the IM above where you are \tn % Row Count 15 (+ 3) % Row 20 \SetRowColor{LightBackground} a & insert text after the cursor \tn % Row Count 17 (+ 2) % Row 21 \SetRowColor{white} e & go to the next word \tn % Row Count 18 (+ 1) % Row 22 \SetRowColor{LightBackground} R\textless{}text\textgreater{} & replace more than one character \tn % Row Count 20 (+ 2) % Row 23 \SetRowColor{white} v and then select what you want & enter the visual mode \tn % Row Count 22 (+ 2) % Row 24 \SetRowColor{LightBackground} y & copy what is selected \tn % Row Count 23 (+ 1) % Row 25 \SetRowColor{white} p & past the copied text \tn % Row Count 24 (+ 1) % Row 26 \SetRowColor{LightBackground} j\$ & go to the end of the line below where you are \tn % Row Count 27 (+ 3) % Row 27 \SetRowColor{white} set hlc & highlight the matching phrases \tn % Row Count 29 (+ 2) % Row 28 \SetRowColor{LightBackground} \textless{}number\textgreater{}j & go x lines below \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{3.833cm}{x{1.51052 cm} x{1.92248 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{vim (cont)}} \tn % Row 29 \SetRowColor{LightBackground} e & go to the end of the word \tn % Row Count 2 (+ 2) % Row 30 \SetRowColor{white} b & go to the previous word \tn % Row Count 4 (+ 2) % Row 31 \SetRowColor{LightBackground} w & go to the next word \tn % Row Count 5 (+ 1) % Row 32 \SetRowColor{white} \{ & next paragraph \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{IM = insert mode} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.54485 cm} x{1.88815 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{terminal and atom}} \tn % Row 0 \SetRowColor{LightBackground} ctrl + shift + r & reverse search (keep pressing to se the other results) \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} cmd + t & search a file \tn % Row Count 4 (+ 1) % Row 2 \SetRowColor{LightBackground} ctrl + ` & open/close a terminal \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} ctrl + tab | ctrl + shift + tab & go to next tab | go to previous tab \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} cmd + shift + {]} | cmd + shift + {[} & go to next tab | go to previous tab \tn % Row Count 9 (+ 2) % Row 5 \SetRowColor{white} cmd + \textbackslash{} & hide the tree view \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} ctrl + 0 & focus on the tree view / back to the file \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} a (in the tree view) & add a file \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} cmd + shift + p & search command and options \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} A: rename file & select file and press m \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{A: atom} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.47619 cm} x{1.95681 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{others}} \tn % Row 0 \SetRowColor{LightBackground} E: cmd + shift + f & simple format \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} E: cmd + shift + h & insert a horizontal line \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{E = evernote} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}