Przeglądaj źródła

added vim cheat sheet

Martin Thoma 12 lat temu
rodzic
commit
c6ec2e2463

+ 8 - 0
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

+ 1 - 0
cheat-sheets/vim/Readme.md

@@ -0,0 +1 @@
+I took http://stdout.org/~winston/latex/ as a template.

+ 55 - 0
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)
+}

BIN
cheat-sheets/vim/vim.pdf


+ 51 - 0
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}