\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{Theverglades} \pdfinfo{ /Title (vim.pdf) /Creator (Cheatography) /Author (Theverglades) /Subject (VIM 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{VIM Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{Theverglades} via \textcolor{DarkBackground}{\uline{cheatography.com/56493/cs/14967/}}} \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}Theverglades \\ \uline{cheatography.com/theverglades} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 3rd March, 2018.\\ 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.69218 cm} x{3.28482 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Général}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:help {[}keyword{]}}} & ouvrir l'aide pour le mot clé \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{:o {[}fichier{]}}} & ouvrir un fichier \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{:w}} & sauvegarder le fichier \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} {\bf{:saveas {[}fichier{]}}} & sauvegarder un fichier sous \tn % Row Count 7 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{:close}} & fermer le fichier en cours \tn % Row Count 8 (+ 1) % Row 5 \SetRowColor{white} {\bf{:wqa}} & sauver et quitter tous les onglets \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{:q}} & quitter \tn % Row Count 11 (+ 1) % Row 7 \SetRowColor{white} {\bf{K}} & ouvre la page du manuel (man) du mot sous le curseur \tn % Row Count 13 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.09034 cm} x{2.88666 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Mouvement du curseur}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{h}} {\bf{j}} {\bf{k}} {\bf{l}} & vers la Gauche / Bas / Haut / Droite \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{H}} {\bf{M}} {\bf{L}} & en Haut / Milieu / Bas de l'écran \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{w}} / {\bf{b}} & en Avant / Arrière au début d'un mot (séparé par des caractères spéciaux) \tn % Row Count 8 (+ 4) % Row 3 \SetRowColor{white} {\bf{W}} / {\bf{B}} & en Avant / Arrière au début d'un mot (séparé par des espaces) \tn % Row Count 11 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{e}} / {\bf{E}} & en avant à la fin d'un mot \tn % Row Count 13 (+ 2) % Row 5 \SetRowColor{white} {\bf{\%}} & au caractère associé: ( ) \{ \} {[} {]} \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{0}} / {\bf{\$}} & au Début / Fin de la ligne \tn % Row Count 17 (+ 2) % Row 7 \SetRowColor{white} {\bf{\textasciicircum{}}} & au Premier / Dernier caractère non-espace de la ligne \tn % Row Count 20 (+ 3) % Row 8 \SetRowColor{LightBackground} {\bf{gg}} / {\bf{G}} & à la Première / Dernière ligne du document \tn % Row Count 22 (+ 2) % Row 9 \SetRowColor{white} {\bf{{\emph{x}}G}} & à la ligne {\emph{x}} \tn % Row Count 23 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{\#}} / {\bf{*}} & au mot identique Précédent / Suivant \tn % Row Count 25 (+ 2) % Row 11 \SetRowColor{white} {\bf{tx}} / {\bf{fx}} & à la Précédente / Prochaine occurence du caractère x \tn % Row Count 28 (+ 3) % Row 12 \SetRowColor{LightBackground} {\bf{(}} / {\bf{)}} & à la Précédente / Prochaine phrase \tn % Row Count 30 (+ 2) \end{tabularx} \par\addvspace{1.3em} \vfill \columnbreak \begin{tabularx}{5.377cm}{x{2.09034 cm} x{2.88666 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Mouvement du curseur (cont)}} \tn % Row 13 \SetRowColor{LightBackground} {\bf{\{}} / {\bf{\}}} & atteindre le Précédent / Prochain paragraphe \tn % Row Count 2 (+ 2) % Row 14 \SetRowColor{white} {\bf{zt}} / {\bf{zb}} / {\bf{zz}} & sur l'écran en Haut / Bas / Centre \tn % Row Count 4 (+ 2) % Row 15 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{y}} {\bf{Ctrl}}+{\bf{e}} & Monter / Descendre l'écran d'une ligne (sans déplacer le curseur) \tn % Row Count 7 (+ 3) % Row 16 \SetRowColor{white} {\bf{Ctrl}}+{\bf{f}} {\bf{Ctrl}}+{\bf{b}} & Monter / Descendre d'une hauteur d'écran \tn % Row Count 9 (+ 2) % Row 17 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{d}} {\bf{Ctrl}}+{\bf{u}} & Monter / Descendre d'une demi hauteur d'écran \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{5.377cm}}{il est possible d'utiliser un nombre comme préfixe pour répéter un mouvement. \newline Exemple : {\bf{4h}} déplace le curseur 4 fois vers la gauche.} \tn \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}{Insertion}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{i}} / {\bf{a}} & Sur / Aprés le curseur \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{I}} / {\bf{A}} & Début / Fin de ligne \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{o}} / {\bf{O}} & ligne Dessous / Dessus la ligne courante \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{Esc}} & quitter le mode insertion \tn % Row Count 7 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Edition}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{r}} & remplacer un caractère \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{R}} & remplace plusieurs caractères \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{cc}} & remplacer une ligne \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{cw}} & remplacer jusqu'à la fin d'un mot \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{c\$}} & remplacer jusqu'à la fin d'une ligne \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} {\bf{J}} & joindre la ligne suivante à la ligne en cours \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{.}} & répéter la commande précédente \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} {\bf{\textasciitilde{}}} & modifier la casse \tn % Row Count 13 (+ 1) % Row 8 \SetRowColor{LightBackground} {\bf{\textless{}}} / {\bf{\textgreater{}}} & décaler le texte vers la Gauche / Droite \tn % Row Count 15 (+ 2) % Row 9 \SetRowColor{white} {\bf{u}} & Annuler \tn % Row Count 16 (+ 1) % Row 10 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{R}} & Rétablir \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{2.18988 cm} x{2.78712 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Copier / Couper / Coller}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{x}} & couper un caractère \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{yw}} / {\bf{dw}} & Copier / Couper un mot \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{y\$}} / {\bf{d\$}} & Copier / Couper jusqu'à la fin d'une ligne \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} {\bf{yy}} / {\bf{dd}} & Copier / Couper une ligne \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{{[}nombre{]}yy}} / {\bf{{[}nombre{]}dd}} & Copier / Couper {[}nombre{]} lignes \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} {\bf{P}} / {\bf{p}} & coller Avant / Après le curseur \tn % Row Count 10 (+ 2) \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}{Rechercher / Substituer}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{/texte}} & chercher le texte \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{n}} / {\bf{N}} & répéter la recherche dans le Même sens / Sens opposé \tn % Row Count 4 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{:\%s/{[}ancien{]}/{[}nouveau{]}/g}} & remplacer {[}ancien{]} par {[}nouveau{]} dans tout le fichier \tn % Row Count 7 (+ 3) \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}{Selectionner du texte (Mode Visuel)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{v}} & passer en mode visuel \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{V}} & passer en mode visuel par ligne \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{v}} & passer en mode visuel par bloc \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\bf{o}} & se déplacer à l'autre extrémité de la zone sélectionnée \tn % Row Count 8 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{O}} & se déplacer au coin opposé de la zone sélectionnée \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{aw}} & selectionner un mot \tn % Row Count 11 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{ab}} / {\bf{aB}} & sélectionner un bloc avec ( ) / {[} {]} \tn % Row Count 13 (+ 2) % Row 7 \SetRowColor{white} {\bf{ib}} / {\bf{iB}} & sélectionner le contenu d'un bloc ( ) / {[} \} \tn % Row Count 15 (+ 2) \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}{Onglets}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:tabnew {[}fichier{]}}} & ouvrir un fichier dans un nouvel onglet \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{gt}} / {\bf{gT}} ou {\bf{:tabn}} / {\bf{:tabp}} & aller à l'onglet Suivant / Précédent \tn % Row Count 5 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{\#gt}} & aller à l'onglet "\#" \tn % Row Count 7 (+ 2) % Row 3 \SetRowColor{white} {\bf{:tabc}} & fermer l'onglet courant \tn % Row Count 9 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{:tabo}} & fermer tous les onglets sauf l'onglet courant \tn % Row Count 12 (+ 3) % Row 5 \SetRowColor{white} {\bf{:tabdo {[}cmd{]}}} & execute la commande sur tous les onglets \tn % Row Count 14 (+ 2) \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}{Fenêtres}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{ws}} & diviser horizontalement \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{Ctrl}}+{\bf{wv}} & diviser verticalement \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{ww}} & changer de fenêtre \tn % Row Count 5 (+ 1) % Row 3 \SetRowColor{white} {\bf{Ctrl}}+{\bf{wq}} & fermer la fenêtre \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{Ctrl}}+{\bf{w}}{[}{\bf{h}},{\bf{j}},{\bf{k}},{\bf{l}}{]} & déplacer le curseur d'une fenêtre à l'autre \tn % Row Count 9 (+ 3) % Row 5 \SetRowColor{white} {\bf{Ctrl}}+{\bf{w=}} & égaliser les fenêtres \tn % Row Count 11 (+ 2) \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}{Buffer}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:e {[}fichier{]}}} & ajouter un buffer \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{:ls}} & lister les buffers \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{:bp}} / {\bf{:bn}} & aller au buffer Précédent / Suivant \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} {\bf{:b{[}n{]}}} & aller au buffer n \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{:w}} & sauvegarder un buffer \tn % Row Count 7 (+ 2) % Row 5 \SetRowColor{white} {\bf{:bd}} & fermer le buffer \tn % Row Count 8 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{:sp {[}fichier{]}}} / {\bf{:vsp {[}fichier{]}}} & ajouter un buffer et diviser la fenêtre Horizontalement / Verticalement \tn % Row Count 12 (+ 4) \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}{Macros}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{q{[}lettre{]}}} & enregistrer la macro {[}lettre{]} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{q}} & arrêter l'enregistrement de la macro \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{@{[}lettre{]}}} & exécuter la macro {[}lettre{]} \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{@@}} & re-exécuter la dernière macro utilisée \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{:reg}} & afficher la macro \tn % Row Count 9 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.29402 cm} x{3.68298 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{Marques}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:marks}} & liste de marques \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{m{[}lettre{]}}} & définir la position actuelle de la marque {[}lettre{]} \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{'{[}lettre{]}}} & accéder à la position de la marque {[}lettre{]} \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} {\bf{y'{[}lettre{]}}} & copier le texte à la position de la marque {[}lettre{]} \tn % Row Count 7 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}