\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{Thiago Alves (thiagoalves)} \pdfinfo{ /Title (personal-vim-shortcuts.pdf) /Creator (Cheatography) /Author (Thiago Alves (thiagoalves)) /Subject (Personal Vim Shortcuts 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}{CCCD92} \definecolor{LightBackground}{HTML}{F8F8F1} \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{Personal Vim Shortcuts Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Thiago Alves (thiagoalves)} via \textcolor{DarkBackground}{\uline{cheatography.com/6320/cs/1073/}}} \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}Thiago Alves (thiagoalves) \\ \uline{cheatography.com/thiagoalves} \\ \uline{\seqsplit{www}.thiagoalves.com.br} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 1st June, 2013.\\ Updated 11th May, 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{4.03137 cm} x{0.94563 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Basics}} \tn % Row 0 \SetRowColor{LightBackground} Edit .vimrc & {\bf{,ev}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Edit .gvimrc & {\bf{,eg}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Edit custom config for work & {\bf{,ew}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Explore remote files & {\bf{,rf}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} Reset remote host info & {\bf{,rn}} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} Vim help for word under cursor & {\bf{,hw}} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} Vim help for WORD under cursor & {\bf{,hW}} \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.2885 cm} x{1.55618 cm} p{0.73232 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Buffers}} \tn % Row 0 \SetRowColor{LightBackground} Go to last used buffer & & {\bf{,bl}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Go to next buffer & & {\bf{,bn}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Go to previous buffer & & {\bf{,bp}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Open alternate\textasciicircum{}1\textasciicircum{} file & {\bf{⌘+⌥+↑}} & {\bf{,A}} \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{\textasciicircum{}1\textasciicircum{} The alternate file is a header for an implementation and vice-versa (e.g. {\emph{.h}} to {\emph{.cpp}})} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{4.13091 cm} x{0.84609 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Vim settings}} \tn % Row 0 \SetRowColor{LightBackground} Toggle highlight search as you type & {\bf{,ht}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} Clear search register & {\bf{,hc}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Toggle spell checking & {\bf{,st}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Toggle show line numbers & {\bf{,ln}} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} Toggle show relative line numbers & {\bf{,lr}} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} Toggle text wrap & {\bf{,lw}} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} Toggle show hidden characters & {\bf{,sc}} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} Toggle doxygen syntax for buffer & {\bf{,xt}} \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.53367 cm} x{1.44333 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Navigation}} \tn % Row 0 \SetRowColor{LightBackground} Scroll buffer right & {\bf{⌃ + L}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Scroll buffer left & {\bf{⌃ + H}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Next entry on quicklist & {\bf{{]}q}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Previous entry on quicklist & {\bf{{[}q}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} First entry on quicklist & {\bf{{[}Q}} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} Last entry on quicklist & {\bf{{]}Q}} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} Search for selected content & {\bf{,ss}} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} Ack cursor word & {\bf{,sa}} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} Ack cursor WORD & {\bf{,sA}} \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.33459 cm} x{1.64241 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Helpers}} \tn % Row 0 \SetRowColor{LightBackground} Move current line up & {\bf{⌃ + K}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Move current line down & {\bf{⌃ + J}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Indent a JSON buffer & {\bf{,ij}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Indent an XML buffer & {\bf{,ix}} \tn % Row Count 4 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{4.08114 cm} x{0.89586 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Fuzyfinder}} \tn % Row 0 \SetRowColor{LightBackground} Buffers & {\bf{,fb}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} File on {\emph{pwd}} & {\bf{,ff}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} File on {\emph{pwd}} traversing directories & {\bf{,fi}} \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} Directories & {\bf{,fd}} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} Recent files & {\bf{,fr}} \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} Recent commands & {\bf{,fc}} \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} Bookmarks & {\bf{,fk}} \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} Tags & {\bf{,ft}} \tn % Row Count 9 (+ 1) % Row 8 \SetRowColor{LightBackground} Tagged file & {\bf{,fe}} \tn % Row Count 10 (+ 1) % Row 9 \SetRowColor{white} Jump list & {\bf{,fj}} \tn % Row Count 11 (+ 1) % Row 10 \SetRowColor{LightBackground} Change list & {\bf{,fg}} \tn % Row Count 12 (+ 1) % Row 11 \SetRowColor{white} Quickfix & {\bf{,fq}} \tn % Row Count 13 (+ 1) % Row 12 \SetRowColor{LightBackground} Lines of current buffer & {\bf{,fl}} \tn % Row Count 14 (+ 1) % Row 13 \SetRowColor{white} Help topics & {\bf{,fh}} \tn % Row Count 15 (+ 1) % Row 14 \SetRowColor{LightBackground} File on buffer's directory & {\bf{,fwf}} \tn % Row Count 17 (+ 2) % Row 15 \SetRowColor{white} Directory on buffer's tree & {\bf{,fwd}} \tn % Row Count 19 (+ 2) % Row 16 \SetRowColor{LightBackground} Tag with cursor word & {\bf{,fiw}} \tn % Row Count 21 (+ 2) % Row 17 \SetRowColor{white} Add bookmark & {\bf{,fab}} \tn % Row Count 23 (+ 2) % Row 18 \SetRowColor{LightBackground} Add bookmark as selected text & {\bf{,fas}} \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \columnbreak \begin{tabularx}{5.377cm}{x{3.73275 cm} x{1.24425 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Eclim}} \tn % Row 0 \SetRowColor{LightBackground} Refresh current projects & {\bf{,pr}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} Refresh all projects & {\bf{,pra}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} Project information & {\bf{,pi}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} Projects Tree & {\bf{,pn}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} Project Todo & {\bf{,pd}} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} Project Problems & {\bf{,pp}} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} Todo & {\bf{,td}} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} Locate file & {\bf{,jf}} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} Validate buffer & {\bf{,vf}} \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} Java Autocorrection & {\bf{,jr}} \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} Java Import Organize & {\bf{,jo}} \tn % Row Count 11 (+ 1) % Row 11 \SetRowColor{white} Java Format & {\bf{,ji}} \tn % Row Count 12 (+ 1) % Row 12 \SetRowColor{LightBackground} Java Hierarchy & {\bf{,jh}} \tn % Row Count 13 (+ 1) % Row 13 \SetRowColor{white} Super class methods & {\bf{,jp}} \tn % Row Count 14 (+ 1) % Row 14 \SetRowColor{LightBackground} Java Doc Search & {\bf{,jd}} \tn % Row Count 15 (+ 1) % Row 15 \SetRowColor{white} Android reload & {\bf{,ar}} \tn % Row Count 16 (+ 1) % Row 16 \SetRowColor{LightBackground} Google word & {\bf{,gt}} \tn % Row Count 17 (+ 1) % Row 17 \SetRowColor{white} Google WORD & {\bf{,gT}} \tn % Row Count 18 (+ 1) % Row 18 \SetRowColor{LightBackground} Google word for android & {\bf{,ga}} \tn % Row Count 19 (+ 1) % Row 19 \SetRowColor{white} Google WORD for android & {\bf{,gA}} \tn % Row Count 20 (+ 1) % Row 20 \SetRowColor{LightBackground} Look up word definition & {\bf{,dt}} \tn % Row Count 21 (+ 1) % Row 21 \SetRowColor{white} Look up WORD definition & {\bf{,dT}} \tn % Row Count 22 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{4.13091 cm} x{0.84609 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Fugitive}} \tn % Row 0 \SetRowColor{LightBackground} git status & {\bf{,gs}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} git commit & {\bf{,gc}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} git commit -{}-amend & {\bf{,gm}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} git log & {\bf{,gl}} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} git blame & {\bf{,gb}} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} git diff & {\bf{,gd}} \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} Write current buffer to the index & {\bf{,gw}} \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} Read from HEAD into current buffer & {\bf{,gr}} \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} Browse changes on current buffer & {\bf{,gb}} \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.88351 cm} x{1.00694 cm} p{0.68655 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Other Plugins}} \tn % Row 0 \SetRowColor{LightBackground} NERDTree & {\bf{F2}} & {\bf{,d}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} NERDTree buffer selected & {\bf{⇧+F2}} & {\bf{,D}} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} Gundo & {\bf{F5}} & {\bf{,u}} \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} Peepopen & & {\bf{,t}} \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} VOom & {\bf{F6}} & {\bf{,vo}} \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} Update help tags for Pathogen & & {\bf{,pt}} \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} Taglist & {\bf{F4}} & {\bf{,tl}} \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} SelectBuf & {\bf{F3}} & \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.24273 cm} x{1.46464 cm} x{0.86963 cm} } \SetRowColor{DarkBackground} \mymulticolumn{3}{x{5.377cm}}{\bf\textcolor{white}{Insert Mode Maps}} \tn % Row 0 \SetRowColor{LightBackground} New line bellow cursor & {\bf{⌃+⏎}} & {\bf{⌃+J}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} New line above cursor & {\bf{⌃+⇧+⏎}} & {\bf{⌃+K}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} Add braces on new line & & {\bf{⌃+H}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} Add braces on same line & & {\bf{⌃+L}} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} Add ';' to EoL\textasciicircum{}1\textasciicircum{} & & {\bf{⌥+;}} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} Add a ':' to EoL\textasciicircum{}1\textasciicircum{} & & {\bf{⌥+:}} \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}---} \SetRowColor{LightBackground} \mymulticolumn{3}{x{5.377cm}}{\textasciicircum{}1\textasciicircum{} End of Line} \tn \hhline{>{\arrayrulecolor{DarkBackground}}---} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{3.83229 cm} x{1.14471 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Work Only}} \tn % Row 0 \SetRowColor{LightBackground} ant clean & {\bf{,wc}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} ant debug & {\bf{,wb}} \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} ant installd & {\bf{,wi}} \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} ant debug install & {\bf{.wa}} \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} ant clean debug install & {\bf{,wf}} \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} adb reboot & {\bf{,wr}} \tn % Row Count 6 (+ 1) % Row 6 \SetRowColor{LightBackground} adb push & {\bf{,wp}} \tn % Row Count 7 (+ 1) % Row 7 \SetRowColor{white} adb connect & {\bf{,ac}} \tn % Row Count 8 (+ 1) % Row 8 \SetRowColor{LightBackground} Start android settings & {\bf{,ws}} \tn % Row Count 9 (+ 1) % Row 9 \SetRowColor{white} Start main activity & {\bf{,wl}} \tn % Row Count 10 (+ 1) % Row 10 \SetRowColor{LightBackground} Open DDMS & {\bf{,ad}} \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}