\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{Juanjo Álvarez (juanjux)} \pdfinfo{ /Title (juanjux-s-vim-cheatsheet.pdf) /Creator (Cheatography) /Author (Juanjo Álvarez (juanjux)) /Subject (Juanjux's Vim Cheatsheet 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}{253D1D} \definecolor{LightBackground}{HTML}{F8F8F7} \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{Juanjux's Vim Cheatsheet Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Juanjo Álvarez (juanjux)} via \textcolor{DarkBackground}{\uline{cheatography.com/19291/cs/2344/}}} \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}Juanjo Álvarez (juanjux) \\ \uline{cheatography.com/juanjux} \\ \uline{\seqsplit{juanjoalvarez}.net} \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Published 17th July, 2014.\\ Updated 12th 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{1.9908 cm} x{2.9862 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Cursor movement and text motions}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{h/j/k/l}} & motion left/up/down/right \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{f / F}} {\emph{char}} & motion to char in current line \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{t / T}} {\emph{char}} & motion 1 before/after char in current line \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{w / B}} & motion to start of next / prev word \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{ e / ge}} & motion to end of next / prev word \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{/{[}regexp{]}}} & search \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{0}} & motion to start of line \tn % Row Count 12 (+ 1) % Row 7 \SetRowColor{white} {\bf{\textasciicircum{}}} / {\bf{ç}} & motion to start of line text \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{\$}} & motion to end of line \tn % Row Count 15 (+ 1) % Row 9 \SetRowColor{white} {\emph{{[}number{]}}} {\bf{G}} / {\bf{gg}} & go to line at {[}number{]} \tn % Row Count 17 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{gg}} & motion to start of buffer \tn % Row Count 19 (+ 2) % Row 11 \SetRowColor{white} {\bf{G}} & motion to end of buffer \tn % Row Count 20 (+ 1) % Row 12 \SetRowColor{LightBackground} {\bf{o}} (visual mode) & move cursor to start/end of selection \tn % Row Count 22 (+ 2) % Row 13 \SetRowColor{white} {\bf{(}} / {\bf{)}} & start / end of phrase \tn % Row Count 23 (+ 1) % Row 14 \SetRowColor{LightBackground} {\bf{\{}} / {\bf{\}}} & start / end of paragraph \tn % Row Count 24 (+ 1) % Row 15 \SetRowColor{white} {\bf{{[}\{}}/{\bf{{]}\}}}/{\bf{{[}(}}/{\bf{{]})}} & motion to next / prev \{ \}( ) \tn % Row Count 26 (+ 2) % Row 16 \SetRowColor{LightBackground} {\bf{\textless{}c-o\textgreater{}}} / {\bf{\textless{}c-i\textgreater{}}} & navigate cursor location history \tn % Row Count 28 (+ 2) % Row 17 \SetRowColor{white} {\bf{:goto}} {\emph{{[}number{]}}} & go to byte at position {\emph{number}} in buffer \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.9908 cm} x{2.9862 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Cursor movement and text motions (cont)}} \tn % Row 18 \SetRowColor{LightBackground} {\bf{*}} / {\bf{\#}} & search next / prev occurrence of word under cursor \tn % Row Count 3 (+ 3) % Row 19 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{ta}} & jump to tag {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 4 (+ 1) % Row 20 \SetRowColor{LightBackground} {\bf{\textless{}c-j\textgreater{}}} / {\bf{\textless{}c-k\textgreater{}}} & pagedown / pageup {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 6 (+ 2) % Row 21 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{e}} & shortcut jump to word {\emph{\textasciicircum{}user|plugin:easymotion\textasciicircum{}}} \tn % Row Count 8 (+ 2) % Row 22 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}\textless{}ldr\textgreater{}{\bf{s}} {\emph{{[}char{]}}} & shortcut jump to {\emph{char}} bidirectional {\emph{\textasciicircum{}plugin:easymotion\textasciicircum{}}} \tn % Row Count 11 (+ 3) % Row 23 \SetRowColor{white} \textless{}ldr\textgreater{}\textless{}ldr\textgreater{}{\bf{e}} & shortcut jump to end of word forward {\emph{\textasciicircum{}plugin:easymotion\textasciicircum{}}} \tn % Row Count 14 (+ 3) % Row 24 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}\textless{}ldr\textgreater{}{\bf{ge}} & shortcut jump to end of word backward {\emph{\textasciicircum{}plugin:easymotion\textasciicircum{}}} \tn % Row Count 17 (+ 3) % Row 25 \SetRowColor{white} {\bf{{[}m}} / {\bf{{]}m}} & jump to prev / next function \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.84149 cm} x{3.13551 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Yank/Paste}} \tn % Row 0 \SetRowColor{LightBackground} {\emph{register:}} "* & system clipboard (Windows) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\emph{register:}} "+ & system clipboard (Linux) \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} {\emph{register:}} "\% & buffer name \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\emph{register:}} *= & output of system() \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} :reg & list of registers \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} {[}register{]}{\bf{y}}{[}motion{]} & yank (yy for current line) \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{p}} / {\bf{P}} & paste at the / before current position \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} :pu / \textless{}ldr\textgreater{}{\bf{,}} & paste below current line {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{gp}} & paste and move the cursor to the end \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{yy}} & show yankring {\emph{\textasciicircum{}user|plugin:yankring\textasciicircum{}}} \tn % Row Count 16 (+ 2) % Row 10 \SetRowColor{LightBackground} \textless{}c-p\textgreater{} {\emph{(after pasting)}} & cycle between recent yanks {\emph{\textasciicircum{}plugin:yankring\textasciicircum{}}} \tn % Row Count 18 (+ 2) % Row 11 \SetRowColor{white} \textless{}ldr\textgreater{}V & select last pasted test \textasciicircum{}{\emph{user}}\textasciicircum{} \tn % Row Count 20 (+ 2) % Row 12 \SetRowColor{LightBackground} \textless{}c-rp\textgreater{} {\emph{register}} & yank from register in insert mode \tn % Row Count 22 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.59264 cm} x{3.38436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{My Plugins}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Pathogen}} & to manage plugins \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{Yankring}} & yank between different instances of Vim. Cycle when pasting \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{Project}} & simple project management. \textbackslash{}C to create a new project, \textbackslash{}R to update files \tn % Row Count 7 (+ 3) % Row 3 \SetRowColor{white} {\bf{NERD\_Commenter}} & easily comment/uncomment code \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{Matchparen}} & shows matching delimiter \tn % Row Count 11 (+ 2) % Row 5 \SetRowColor{white} {\bf{Csapprox}} & use GVim colorschemes in console Vim \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{Airline}} & awesome status bar \tn % Row Count 14 (+ 1) % Row 7 \SetRowColor{white} {\bf{Tagbar}} & jumpable tag list \tn % Row Count 15 (+ 1) % Row 8 \SetRowColor{LightBackground} {\bf{Vimwiki}} & personal Wiki \tn % Row Count 16 (+ 1) % Row 9 \SetRowColor{white} {\bf{Syntastic}} & Validate syntax for several languages \tn % Row Count 18 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{EasyMotion}} & jump to any word/line/character with few keystrokes \tn % Row Count 20 (+ 2) % Row 11 \SetRowColor{white} {\bf{Unite}} & Fuzzy search for buffers/files/etc \tn % Row Count 22 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{Matchit}} & improves VIm's \% command to understant more delimiters \tn % Row Count 24 (+ 2) % Row 13 \SetRowColor{white} {\bf{MatchTagAlways}} & highlight matching HTML tags \tn % Row Count 26 (+ 2) % Row 14 \SetRowColor{LightBackground} {\bf{Tabular}} & align things \tn % Row Count 27 (+ 1) % Row 15 \SetRowColor{white} {\bf{Emmet}} & Quickly edit HTML and move between tags \tn % Row Count 29 (+ 2) % Row 16 \SetRowColor{LightBackground} {\bf{YouCompleteMe}} & excellent completion \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.59264 cm} x{3.38436 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{My Plugins (cont)}} \tn % Row 17 \SetRowColor{LightBackground} {\bf{VimColorSchemes}} & lot of colorschemes \tn % Row Count 2 (+ 2) % Row 18 \SetRowColor{white} {\bf{Surround}} & operations on delimiters \tn % Row Count 3 (+ 1) % Row 19 \SetRowColor{LightBackground} {\bf{Jdaddy}} & add a JSON text object \tn % Row Count 4 (+ 1) % Row 20 \SetRowColor{white} {\bf{GTFO}} & shortcuts to open GUI file explorer or terminal in buffer CWD \tn % Row Count 7 (+ 3) % Row 21 \SetRowColor{LightBackground} {\bf{Ack}} & :Ack search (but use ag instead of Ack!) \tn % Row Count 9 (+ 2) % Row 22 \SetRowColor{white} {\bf{Repeat}} & the repeat operator (dot) will be able to repeat some plugin actions \tn % Row Count 12 (+ 3) % Row 23 \SetRowColor{LightBackground} {\bf{LustyJuggler}} & Show buffers as a list, switch with a number \tn % Row Count 14 (+ 2) % Row 24 \SetRowColor{white} {\bf{Rename}} & :Rename current buffer and the associated file \tn % Row Count 16 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Operators: {[}repeat{]}operator{[}motion{]}}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{d}} & delete, dd for line \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{c}} & change (delete and enter insert), cc for line \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{y}} & yank (yy for line) \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{gu}} / {\bf{gU}} & to lowercase / uppercase \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{!}} & filter through external program \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} {\bf{=}} & auto indent \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{gw}} & justify \tn % Row Count 10 (+ 1) % Row 7 \SetRowColor{white} {\bf{\textgreater{}}} / {\bf{\textless{}}} & indent / dedent \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{{[}repeat{]} {[}operator{]} {[}motion or text object{]} \newline Examples: \newline 10dj (delete 10 lines down) \newline v3w (select 3 words ahead) \newline yiw (yank the inner-word object) \newline gwip (justify the inner-paragraph object) \newline 3diw (delete the next 3 inner-words)} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.38896 cm} x{2.58804 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Text edition (see also operators \& motions)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{i}} & enter insert mode \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{a}} & enter insert mode after cursor position (append) \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{x}} & delete char under cursor \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{r}}{\emph{{[}newchar{]}}} & replace char under cursor \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{I}} & move to start of line and insert \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{A}} & move to end of line and append \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{D}} & delete from cursor to end of line \tn % Row Count 14 (+ 2) % Row 7 \SetRowColor{white} {\bf{C}} & change from cursor to end of line \tn % Row Count 16 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{o}} / {\bf{O}} & create new line and insert below / above cursor position \tn % Row Count 19 (+ 3) % Row 9 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{o}} / \textless{}ldr\textgreater{}{\bf{O}} & create new line above / below without going to insert mode \tn % Row Count 22 (+ 3) % Row 10 \SetRowColor{LightBackground} :tab /{\emph{{[}char{]}}}/l1 & tabularize from {\emph{{[}char{]}}} left align 1 space {\emph{\textasciicircum{}plugin:tabularize\textasciicircum{}}} \tn % Row Count 26 (+ 4) % Row 11 \SetRowColor{white} {\bf{ys}}{\emph{{[}motion{]}}} {\emph{{[}delimiter{]}}} & surround motion/object with delimiter {\emph{\textasciicircum{}plugin:surround\textasciicircum{}}} \tn % Row Count 29 (+ 3) % Row 12 \SetRowColor{LightBackground} {\bf{S}}{[}visual selection{]} {\emph{{[}delimiter{]}}} & surround visual selection with delimiter \tn % Row Count 31 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.38896 cm} x{2.58804 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Text edition (see also operators \& motions) (cont)}} \tn % Row 13 \SetRowColor{LightBackground} {\bf{cs}}{\emph{{[}delimiter{]}}} {\emph{{[}newdelim{]}}} & change surrounding delimiter for {\emph{newdelim}} {\emph{\textasciicircum{}plugin:surround\textasciicircum{}}} \tn % Row Count 4 (+ 4) % Row 14 \SetRowColor{white} {\bf{ds}}{\emph{{[}delimiter{]}}} & delete surrounding {\emph{delimiter}} {\emph{\textasciicircum{}plugin:surround\textasciicircum{}}} \tn % Row Count 7 (+ 3) % Row 15 \SetRowColor{LightBackground} \textless{}ldr\textgreater{} {\bf{c\textless{}space\textgreater{}}} & comment / uncomment \tn % Row Count 8 (+ 1) % Row 16 \SetRowColor{white} {\bf{J}} & join lines \tn % Row Count 9 (+ 1) % Row 17 \SetRowColor{LightBackground} {\emph{{[}operator{]}}} \textless{}ldr\textgreater{}{\bf{e}} & shortcut operate by lines with {\emph{\textasciicircum{}plugin:easymotion\textasciicircum{}}} \tn % Row Count 12 (+ 3) % Row 18 \SetRowColor{white} {\bf{\textless{}c-w\textgreater{}}} (insert mode) & delete one word back \tn % Row Count 14 (+ 2) \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}{Ex Commandline}} \tn % Row 0 \SetRowColor{LightBackground} {\emph{range:}} {\bf{\%}} & full buffer \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\emph{range:}} {\bf{.}} {\emph{(dot)}} & current line \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\emph{range:}} {\bf{\$}} & last line \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\emph{range:}} {\emph{+-N}} & +-N lines from current position \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} {\emph{selector:}} {\bf{g}} & global command (selects lines matching regexp) \tn % Row Count 9 (+ 3) % Row 5 \SetRowColor{white} {\emph{selector:}} {\bf{v}} & inverse (select lines NOT matching regexp) \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} {\emph{operator:}} {\bf{d}} & delete \tn % Row Count 12 (+ 1) % Row 7 \SetRowColor{white} {\emph{operator:}} {\bf{!}}{\emph{{[}program{]}}} & replaces with output from external program \tn % Row Count 14 (+ 2) % Row 8 \SetRowColor{LightBackground} {\emph{operator:}} {\bf{s}}/{\emph{old}}/{\emph{new}} & replaces {\emph{old}} with {\emph{new}} \tn % Row Count 16 (+ 2) % Row 9 \SetRowColor{white} {\emph{operator:}} {\bf{y}} & yank \tn % Row Count 17 (+ 1) % Row 10 \SetRowColor{LightBackground} {\emph{operator:}} {\bf{normal}} {\emph{{[}commands{]}}} & run {\emph{commands}} over every line in the range or selection \tn % Row Count 20 (+ 3) % Row 11 \SetRowColor{white} {\emph{operator:}} {\bf{put}} {\emph{{[}register{]}}} & put the register content below the current line \tn % Row Count 23 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{The format is one of: \newline :{[}range{]}{[}selector{]}/{[}regexp{]}/{[}operation{]} \newline :{[}range{]}{[}operation{]} \newline :{[}operation{]} \newline Example: \newline :20,30g/FIXME/d =\textgreater{} delete lines from 20 to 30 with the string FIXME \newline :.,\$v/DONTDELETE/d =\textgreater{} delete lines without the string DONTDELETE from current position to end of buffer. \newline :\%s/old/new =\textgreater{} replace all instances of old with new \newline :.!ls =\textgreater{} insert output of ls replacing current line} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.9908 cm} x{2.9862 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Emmet plugin for HTML}} \tn % Row 0 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\emph{(insert mode)}} & expand HTML abbreviature like: {\emph{Div\#page\textgreater{}div.logo+ul\textgreater{}li}}5*\textgreater{}a \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \textless{}c-y\textgreater{} {\bf{,}} {\emph{(visual mode)}} & wrap selection inside tag (asks for tag) \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\bf{n/N}} & jump to next / prev editable point \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} \textless{}c-y\textgreater{} {\bf{k}} & remove current tag \tn % Row Count 8 (+ 1) % Row 4 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\bf{/}} & comment tag \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} \textless{}c-y\textgreater{} {\bf{a}} & converts URL to \textless{}A\textgreater{} tag \tn % Row Count 10 (+ 1) % Row 6 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\bf{A}} & converts URL to \textless{}A\textgreater{} tag autoloading site description \tn % Row Count 13 (+ 3) % Row 7 \SetRowColor{white} \textless{}c-y\textgreater{} {\bf{c}} & prettify code with CSS classes by type \tn % Row Count 15 (+ 2) % Row 8 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\bf{d}} & sleect tag surrounding the cursor \tn % Row Count 17 (+ 2) % Row 9 \SetRowColor{white} \textless{}c-y\textgreater{} {\bf{D}} & select next inside tag or next tag \tn % Row Count 19 (+ 2) % Row 10 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\bf{i}} & update image size \tn % Row Count 20 (+ 1) % Row 11 \SetRowColor{white} \textless{}c-y\textgreater{} {\bf{j}} & join separate block: \textless{}p\textgreater{}\textless{}/p\textgreater{} ⇒ \textless{}p/\textgreater{} \tn % Row Count 22 (+ 2) % Row 12 \SetRowColor{LightBackground} \textless{}c-y\textgreater{} {\bf{,}} & with "lorem" in insert mode, writes lorem ipsum \tn % Row Count 24 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.24425 cm} x{3.73275 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Spellcheck}} \tn % Row 0 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{ss}} & spanish spell check {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{se}} & english spell check \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{sn}} & disable spell check \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{z=}} & suggestions for word under cursor \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{{]}s / {[}s}} & next / prev misspelled word \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{zg}} & add word to user dictionary \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.64241 cm} x{3.33459 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Text Objects i/a{[}object{]}}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{l}} & char \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{w}}/{\bf{W}} & word / WORD \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{s}} & sentence \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {\bf{(}}/{\bf{)}} or {\bf{b}} & (block) \tn % Row Count 5 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{\{}}/{\bf{\}}} or {\bf{B}} & \{block\} \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} {\bf{j}} & JSON block, use gw to prettify {\emph{\textasciicircum{}plugin:jdaddy\textasciicircum{}}} \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{p}} & paragraph \tn % Row Count 10 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.69218 cm} x{3.28482 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Windows / Buffers / Tabs / Splits}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:w}} & save buffer \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{:q}}/{\bf{:x}} & exit / save and exit \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{:e}}{\emph{ {[}path{]}}} & open file at {\emph{path}}, use "." for netrw browser \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} {\bf{:bd}} & delete buffer (doesn't delete file) \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{v}} & create vertical split and jump to it {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{tn}} & new tab {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 9 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{\textless{}c-h\textgreater{}}} / {\bf{\textless{}c-l\textgreater{}}} & move to left / right tab {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 11 (+ 2) % Row 7 \SetRowColor{white} {\emph{{[}number{]}{\bf{}}gt}} & go to tab {\emph{{[}number{]}}} \tn % Row Count 13 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{:sp}} & create horizontal split \tn % Row Count 14 (+ 1) % Row 9 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{cv}} & close current split {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 16 (+ 2) % Row 10 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{bt}} & open all buffers in tabs {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 18 (+ 2) % Row 11 \SetRowColor{white} {\bf{:tabm}} {\emph{{[}pos{]}}} & move tab to pos (can be +/-pos) \tn % Row Count 20 (+ 2) % Row 12 \SetRowColor{LightBackground} {\bf{\textless{}space\textgreater{}\textless{}space\textgreater{}}} & Unite buffers/MRU {\emph{\textasciicircum{}user|plugin:unite\textasciicircum{}}} \tn % Row Count 22 (+ 2) % Row 13 \SetRowColor{white} \textless{}space\textgreater{}{\bf{b}} & Unite buffers {\emph{\textasciicircum{}plugin:unite\textasciicircum{}}} \tn % Row Count 24 (+ 2) % Row 14 \SetRowColor{LightBackground} \textless{}space\textgreater{}{\bf{m}} & Unite most recently used {\emph{\textasciicircum{}plugin:unite\textasciicircum{}}} \tn % Row Count 26 (+ 2) % Row 15 \SetRowColor{white} \textless{}space\textgreater{}{\bf{f}} & Unite search files recursively {\emph{\textasciicircum{}plugin:unite\textasciicircum{}}} \tn % Row Count 28 (+ 2) % Row 16 \SetRowColor{LightBackground} \textless{}c-w\textgreater{}{\bf{T}} & Convert split to tab \tn % Row Count 29 (+ 1) % Row 17 \SetRowColor{white} \textless{}c-w\textgreater{}{\bf{r}} & Rotate split positions \tn % Row Count 30 (+ 1) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{1.69218 cm} x{3.28482 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Windows / Buffers / Tabs / Splits (cont)}} \tn % Row 18 \SetRowColor{LightBackground} {\bf{:tabo}} & close all tabs except current \tn % Row Count 2 (+ 2) % Row 19 \SetRowColor{white} {\bf{:w!!}} & save buffer as root with sudo {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 4 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.94103 cm} x{3.03597 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Marks}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{m}}{\emph{{[}mark{]}}} & create mark {\emph{{[}mark{]}}} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{'}}{\emph{{[}mark{]}}} & jump to start of line with {\emph{{[}mark{]}}} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{`}}{\emph{{[}mark{]}}} / {\bf{¡}} & jump to {\emph{{[}mark{]}}} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\emph{mark}}: {\bf{0}} {\emph{(zero)}} & last file edited \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} {\emph{mark}}: {\bf{'}} & before last jump \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} {\emph{mark}}: {\bf{,}} & last edition point \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.04057 cm} x{2.93643 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Undo / Redo}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{u}} & undo \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{\textless{}c-r\textgreater{}}} & redo \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{:earlier}} {\emph{{[}time spec{]}}} & s:second / m:minute / h:hour / d:days \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} {\bf{:later}} {\emph{{[}time spec{]}}} & s:second / m:minute / h:hour / d:days \tn % Row Count 6 (+ 2) \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}{Misc}} \tn % Row 0 \SetRowColor{LightBackground} \textless{}c-o\textgreater{} {\emph{(insert mode)}} & run a command in insert mode \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{cdt}} & update D tags {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{ct}} & clear trailing whitespace {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{sv}} & reload .vimrc {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{rr}} & systax on and off (to reset colors) {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 11 (+ 3) % Row 5 \SetRowColor{white} {\bf{za / zA}} & toggle fold / class level \tn % Row Count 13 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{gof}} & open graphical file browser in buffer cwd {\emph{\textasciicircum{}plugin:gtfo\textasciicircum{}}} \tn % Row Count 16 (+ 3) % Row 7 \SetRowColor{white} {\bf{got}} & open command terminal in buffer cwd {\emph{\textasciicircum{}plugin:gtfo\textasciicircum{}}} \tn % Row Count 19 (+ 3) % Row 8 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{\textless{}space\textgreater{}}} & clear search result highlights {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 21 (+ 2) % Row 9 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{gs}} & save vim session {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 23 (+ 2) % Row 10 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{css}} & load vim session {\emph{\textasciicircum{}user\textasciicircum{}}} \tn % Row Count 25 (+ 2) % Row 11 \SetRowColor{white} {\bf{v / V}} & enter visual mode / by line \tn % Row Count 27 (+ 2) % Row 12 \SetRowColor{LightBackground} \textless{}c-v\textgreater{} & visual block selection (I to insert before, A to append after) \tn % Row Count 30 (+ 3) \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}{Misc (cont)}} \tn % Row 13 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{tb}} & open tag bar split {\emph{\textasciicircum{}user|plugin:tagbar\textasciicircum{}}} \tn % Row Count 2 (+ 2) % Row 14 \SetRowColor{white} \textless{}ldr\textgreater{}{\bf{P}} & open project split {\emph{\textasciicircum{}user|plugin:project\textasciicircum{}}} \tn % Row Count 4 (+ 2) % Row 15 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{sy}} & syntactic check with syntactic {\emph{\textasciicircum{}user|plugin:syntactic\textasciicircum{}}} \tn % Row Count 7 (+ 3) % Row 16 \SetRowColor{white} :Ack & search with Ack/ag \tn % Row Count 8 (+ 1) % Row 17 \SetRowColor{LightBackground} :windo diffthis & mark split for windiff (do twice) \tn % Row Count 10 (+ 2) % Row 18 \SetRowColor{white} . {\bf{(dot)}} & repeat last change \tn % Row Count 11 (+ 1) % Row 19 \SetRowColor{LightBackground} :sort {\bf{{[}selection{]}}} & sorts the selection \tn % Row Count 13 (+ 2) % Row 20 \SetRowColor{white} {\bf{:Rename}} & rename current buffer and file {\emph{\textasciicircum{}plugin:rename\textasciicircum{}}} \tn % Row Count 16 (+ 3) % Row 21 \SetRowColor{LightBackground} \textless{}ldr\textgreater{}{\bf{lj}} & show buffer list, switch with a number {\emph{\textasciicircum{}plugin:lustyjuggler\textasciicircum{}}} \tn % Row Count 19 (+ 3) % Row 22 \SetRowColor{white} {\bf{@:}} & repeat last ex mode command \tn % Row Count 21 (+ 2) % Row 23 \SetRowColor{LightBackground} {\emph{{[}Bash Shell{]}}} {\bf{set -o vi}} & put bash commandline in vi mode \tn % Row Count 23 (+ 2) % Row 24 \SetRowColor{white} {\emph{{[}Bash shell in vi mode{]}}} {\bf{\textless{}esc\textgreater{}v}} & edit shell command in Vim \tn % Row Count 25 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{5.377cm}}{\bf\textcolor{white}{Tricks}} \tn % Row 0 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{{\bf{xp}} in normal mode to exchange two chars} \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} \mymulticolumn{1}{x{5.377cm}}{{\bf{ddp}} to exchange two lines (or lower the current one one down)} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} \mymulticolumn{1}{x{5.377cm}}{In the Bash shell, use {\bf{set -o vi}} to enable Vi mode. Then use \textless{}esc\textgreater{} and edit your command like in Vi or use {\bf{v}} to edit your command line in Vim} \tn % Row Count 6 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}