diff --git a/cheat-sheets/vim/Makefile b/cheat-sheets/vim/Makefile new file mode 100644 index 0000000..ee02ba1 --- /dev/null +++ b/cheat-sheets/vim/Makefile @@ -0,0 +1,8 @@ +SOURCE = vim + +make: + pdflatex $(SOURCE).tex -output-format=pdf + make clean + +clean: + rm -rf $(TARGET) *.class *.html *.log *.aux diff --git a/cheat-sheets/vim/Readme.md b/cheat-sheets/vim/Readme.md new file mode 100644 index 0000000..ec5760a --- /dev/null +++ b/cheat-sheets/vim/Readme.md @@ -0,0 +1 @@ +I took http://stdout.org/~winston/latex/ as a template. diff --git a/cheat-sheets/vim/myStyle.sty b/cheat-sheets/vim/myStyle.sty new file mode 100644 index 0000000..28b416e --- /dev/null +++ b/cheat-sheets/vim/myStyle.sty @@ -0,0 +1,55 @@ +\usepackage{multicol} +\usepackage{calc} +\usepackage{ifthen} +\usepackage[landscape]{geometry} + +% This sets page margins to .5 inch if using letter paper, and to 1cm +% if using A4 paper. (This probably isn't strictly necessary.) +% If using another size paper, use default 1cm margins. +\ifthenelse{\lengthtest { \paperwidth = 11in}} + { \geometry{top=.5in,left=.5in,right=.5in,bottom=.5in} } + {\ifthenelse{ \lengthtest{ \paperwidth = 297mm}} + {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } + {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} } + } + +% Turn off header and footer +\pagestyle{empty} + + +% Redefine section commands to use less space +\makeatletter +\renewcommand{\section}{\@startsection{section}{1}{0mm}% + {-1ex plus -.5ex minus -.2ex}% + {0.5ex plus .2ex}%x + {\normalfont\large\bfseries}} +\renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}% + {-1explus -.5ex minus -.2ex}% + {0.5ex plus .2ex}% + {\normalfont\normalsize\bfseries}} +\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{0mm}% + {-1ex plus -.5ex minus -.2ex}% + {1ex plus .2ex}% + {\normalfont\small\bfseries}} +\makeatother + +% Define BibTeX command +\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em + T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} + +% Don't print section numbers +\setcounter{secnumdepth}{0} + + +\setlength{\parindent}{0pt} +\setlength{\parskip}{0pt plus 0.5ex} + +\usepackage{menukeys} + +\pdfinfo{ + /Author (Martin Thoma) + /Title (Vim Cheat Sheet) + /CreationDate (D:20130415072400) + /Subject (Vim) + /Keywords (Vim;Cheat Sheet) +} diff --git a/cheat-sheets/vim/vim.pdf b/cheat-sheets/vim/vim.pdf new file mode 100644 index 0000000..0343021 Binary files /dev/null and b/cheat-sheets/vim/vim.pdf differ diff --git a/cheat-sheets/vim/vim.tex b/cheat-sheets/vim/vim.tex new file mode 100644 index 0000000..1bd7165 --- /dev/null +++ b/cheat-sheets/vim/vim.tex @@ -0,0 +1,51 @@ +\documentclass[a4paper,10pt,landscape]{article} +\usepackage{myStyle} + +\begin{document} + +\raggedright +\footnotesize +\begin{multicols}{3} + + +% multicol parameters +% These lengths are set only within the two main columns +%\setlength{\columnseprule}{0.25pt} +\setlength{\premulticols}{1pt} +\setlength{\postmulticols}{1pt} +\setlength{\multicolsep}{1pt} +\setlength{\columnsep}{2pt} + +\begin{center} + \Large{\textbf{Vim}} \\ +\end{center} + +\section{Basic commands} +\begin{tabular}{@{}ll@{}} +\verb!:w [file]! & Write to \textit{file} \\ +\verb!:x! & Exit, saving changes \\ +\verb!:q! & Exit as long as there have been no changes \\ +\verb!:q!! & Exit and ignore any changes \\ +\verb!:wq! & Save file and exit +\end{tabular} + +\section{Inserting Text} +\begin{tabular}{@{}ll@{}} +\keys{i} & Insert before cursor \\ +\keys{I} & Insert before line \\ +\end{tabular} + +\section{Motion} +\begin{tabular}{@{}ll@{}} +\keys{h} & Move left \\ +\keys{j} & Move down \\ +\keys{k} & Move up \\ +\keys{l} & Move right \\ +\keys{w} & Move to next word \\ +\keys{W} & Move to next blank delimited word \\ +\keys{e} & Move to the end of the word \\ +\end{tabular} + + +\end{multicols} +\end{document}