\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{john666} \pdfinfo{ /Title (vim.pdf) /Creator (Cheatography) /Author (john666) /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}{86AFAD} \definecolor{LightBackground}{HTML}{F7FAF9} \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}{john666} via \textcolor{DarkBackground}{\uline{cheatography.com/30346/cs/9030/}}} \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}john666 \\ \uline{cheatography.com/john666} \\ \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 8th September, 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.34379 cm} x{3.63321 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{移動(全体)}} \tn % Row 0 \SetRowColor{LightBackground} h & カーソルを左へ \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} j & カーソルを下へ(g) \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} k & カーソルを上へ(g) \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} l & カーソルを右へ \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} H & \seqsplit{カーソルを画面の最上の行へ} \tn % Row Count 6 (+ 2) % Row 5 \SetRowColor{white} M & \seqsplit{カーソルを画面の中央の行へ} \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} L & \seqsplit{カーソルを画面の最下の行へ} \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} CTRL-U / CTRL-D & ウィンドウを半画面({\bf{上}}/{\bf{下}})へ \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} CTRL-B / CTRL-F & ウィンドウを1画面({\bf{上}}/{\bf{下}})へ \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} CTRL-O / CTRL-I & 1個({\bf{前}}/{\bf{後}})のジャンプリストの位置へ \tn % Row Count 16 (+ 2) % Row 10 \SetRowColor{LightBackground} g; / g, & 1個({\bf{前}}/{\bf{後}})の変更リストの位置へ \tn % Row Count 18 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{移動(行)}} \tn % Row 0 \SetRowColor{LightBackground} 0 / \$ & カーソルを行({\bf{頭}}/{\bf{末}})へ(g) \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \textasciicircum{} & \seqsplit{カーソルを行の先頭の} CHAR へ(g) \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} -/+ & カーソルを1行({\bf{上}}/{\bf{下}})の先頭の CHAR へ \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} gg/G & カーソルを({\bf{1行目}}/{\bf{最終行}})へ \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} gg/G & N 行目へ、省略時は({\bf{1行目}}/{\bf{最終行}}) \tn % Row Count 10 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{移動(単語)}} \tn % Row 0 \SetRowColor{LightBackground} w / b & カーソルを直({\bf{後}}/{\bf{前}})のワードへ \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} W / B & カーソルを直({\bf{後}}/{\bf{前}})の WORD へ \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} e / ge & カーソルを直({\bf{後}}/{\bf{前}})のワードの末尾へ \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} E / gE & カーソルを直({\bf{後}}/{\bf{前}})の WORD の末尾へ \tn % Row Count 8 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.64701 cm} x{4.32999 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{範囲選択}} \tn % Row 0 \SetRowColor{LightBackground} v / V & ({\bf{文字}}/{\bf{行}})指定のビジュアルモードへ \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} \seqsplit{CTRL-V} & \seqsplit{矩形ビジュアルモードを開始} \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} gv & \seqsplit{前回の選択範囲を再選択} \tn % Row Count 5 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.54747 cm} x{4.42953 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{テキスト挿入}} \tn % Row 0 \SetRowColor{LightBackground} i / a & カーソルの({\bf{前}}/{\bf{後}})から挿入モードへ \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} gI/A & 行({\bf{頭}}/{\bf{末}})から挿入モードへ \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} I & 行の先頭の CHAR から挿入モードへ \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} o/O & 1行({\bf{下}}/{\bf{上}})に行を追加し、挿入モードへ \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} gi & \seqsplit{最後に挿入モードを抜けた位置から挿入モードへ} \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} p / P & カーソルの({\bf{後}}/{\bf{前}})にバッファのテキストを挿入 \tn % Row Count 13 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.4977 cm} x{4.4793 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{\seqsplit{テキスト編集(バッファ保存)}}} \tn % Row 0 \SetRowColor{LightBackground} yy & N 行をヤンク \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} dd & N 行を削除 \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} cc & N \seqsplit{行を削除し、挿入モードへ} \tn % Row Count 4 (+ 2) % Row 3 \SetRowColor{white} x & カーソル位置から N 文字を削除 \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} X & カーソルの前の N 文字を削除 \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} s & カーソル位置から N \seqsplit{文字を削除し、挿入モードへ} \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} D & \seqsplit{カーソル位置から行末までのテキストを削除} \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} C & \seqsplit{カーソル位置から行末までのテキストを削除し、挿入モードへ} \tn % Row Count 15 (+ 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}{\seqsplit{テキストオブジェクト}}} \tn % Row 0 \SetRowColor{LightBackground} (y|d|c) ai / iw & カーソル位置の文字列をワードとして指定(前後の空白を({\bf{含む}}|{\bf{含まない}})) \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} (y|d|c) aW/iW & \seqsplit{カーソル位置の文字列を} WORD として指定(前後の空白を({\bf{含む}}|{\bf{含まない}})) \tn % Row Count 8 (+ 4) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{プログラミング}} \tn % Row 0 \SetRowColor{LightBackground} \% & \seqsplit{現在の行にある次の括弧やC風コメントの対、対応するプリプロセッサーなどに移動} \tn % Row Count 4 (+ 4) % Row 1 \SetRowColor{white} gd / gD & カーソル位置の単語の定義を({\bf{現在の関数}}/{\bf{カレントファイル}})内で検索し、移動 \tn % Row Count 8 (+ 4) % Row 2 \SetRowColor{LightBackground} \textless{}\textless{}/ \textgreater{}\textgreater{} & N 行を({\bf{左}}/{\bf{右}})へシフト \tn % Row Count 10 (+ 2) % Row 3 \SetRowColor{white} == & N \seqsplit{行のインデントを調整} \tn % Row Count 11 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{p{0.74655 cm} x{4.23045 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{テキスト編集}} \tn % Row 0 \SetRowColor{LightBackground} J / gJ & N 行を結合(スペース({\bf{有}}/{\bf{無}}))、省略時は2行 \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} r\{char\} & カーソル位置から N 文字を \{char\} で置換 \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} R & \seqsplit{カーソル位置から置換モードへ(上書き)} \tn % Row Count 6 (+ 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}{検索}} \tn % Row 0 \SetRowColor{LightBackground} /\{pattern\}↲ & \{pattern\} \seqsplit{で前方検索し、最初に見つかった位置へ移動} \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} ?\{pattern\}↲ & \{pattern\} \seqsplit{で後方検索し、最初に見つかった位置へ移動} \tn % Row Count 6 (+ 3) % Row 2 \SetRowColor{LightBackground} \# / * & カーソル位置の単語で({\bf{後}}/{\bf{前}})方検索し、最初に見つかった位置へ移動 \tn % Row Count 10 (+ 4) % Row 3 \SetRowColor{white} n & 最後の '/' or '?' を繰返す \tn % Row Count 12 (+ 2) % Row 4 \SetRowColor{LightBackground} N & 最後の '/' or '?' を逆方向に実行 \tn % Row Count 14 (+ 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}{置換}} \tn % Row 0 \SetRowColor{LightBackground} :s/\{pattern\}/ \{replace\}/↲ & \{pattern\}で一致したテキストを\{replace\}で置換 \tn % Row Count 3 (+ 3) % Row 1 \SetRowColor{white} \& & 最後に実行した ":s" を繰返す \tn % Row Count 5 (+ 2) % Row 2 \SetRowColor{LightBackground} g\& & 最後に実行した ":s" \seqsplit{をすべての行で実行} \tn % Row Count 8 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{5.377cm}{x{1.14471 cm} x{3.83229 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{5.377cm}}{\bf\textcolor{white}{全般}} \tn % Row 0 \SetRowColor{LightBackground} CTRL-G & \seqsplit{現在のファイル名とカーソル位置を表示} \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} . & \seqsplit{最後の編集を繰返す} \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} g- / g+ & ({\bf{古い}}/{\bf{新しい}})テキスト状態へ移動 \tn % Row Count 5 (+ 2) % Row 3 \SetRowColor{white} u & 変更をアンドゥ \tn % Row Count 6 (+ 1) % Row 4 \SetRowColor{LightBackground} U & \seqsplit{1行中の最近の変更をすべて取消} \tn % Row Count 8 (+ 2) % Row 5 \SetRowColor{white} CTRL-R & 'u' \seqsplit{でアンドゥした変更をリドゥ} \tn % Row Count 10 (+ 2) % Row 6 \SetRowColor{LightBackground} Esc / CTRL-{[} & 挿入モードを終了 \tn % Row Count 12 (+ 2) % Row 7 \SetRowColor{white} :wq & \seqsplit{変更を保存して終了} \tn % Row Count 13 (+ 1) % Row 8 \SetRowColor{LightBackground} :q! & \seqsplit{変更を保存しないで終了} \tn % Row Count 15 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}