Slight rewrite of genrefcard.pl
[grml-gen-zshrefcard.git] / grml-zsh-refcard.tex.in
1 \documentclass[8pt,             % 8pt
2                a4paper,         % A4
3                oneside,         % Einseitig
4                DIV20,           % Papiergröße
5              % DIV15,           % Größer
6              % draft,           % Entwurf
7                headsepline,     % Trennlinie oben
8                footsepline,     % -""-       unten
9                smallheadings,   % Kleine Überschriften
10              % pointlessnumbers,% Keine Punkte
11                halfparskip,     % Halbe Zeile Absatz statt Einzug
12                nochapterprefix, % Kein "Kapitel"
13              % bibtotoc         % "Literatur" im TOC  oder
14              % bibtotocnumbered,% -""-, nummeriert
15              % idxtotoc,        % Index im TOC
16                twocolumn
17               ]{scrartcl}
18
19 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
20 %%% Pakete {{{
21 \usepackage[latin1]{inputenc}       % ISO-Umlaute
22 \usepackage[T1]{fontenc}            % T1-kodierte Fonts
23 \usepackage{ae,aecompl}             % Kodierung für PDF
24 %\usepackage{ngerman}                % Deutsche Trennungen,
25                                     % dt. Begriffe
26 \usepackage{setspace}               % Single- oder Onehalfspacing
27 %\setcounter{tocdepth}{4}            % 4 Hirarchien im Inhaltsv.
28 \usepackage{times}                  % Times als Schrift
29 \usepackage{amsmath,amssymb,amstext}% Mathematische Symbole
30 \usepackage{url}                    % Darstellung von URLs
31 \usepackage{calc}
32
33 %%% Optional, je nach Dokument
34 % \usepackage{listings}             % Quelltext-Listings
35 % \usepackage{units}                % Technische Units
36 % \usepackage{psfrag}               % Ersetzts PS-Schriften
37 % \usepackage{color}                % Farben in LaTeX
38 % \usepackage{floatflt}             % Textumflossene Bilder...
39 % \usepackage{picins}               % Textumflossene Bilder
40 % \usepackage{textcomp}             % Spezielle Zeichen
41 % \usepackage[small,compact]{titlesec}             % Überschriften mit wenig Platz
42 % \usepackage{gensymb}              % Spezielle Zeichen
43 % \usepackage{eurosym}              % Euro-Symbol
44
45 %%% Layout
46 \usepackage{scrpage2}               % KOMA-Überschriften und -Fußzeilen.
47 %%% }}}
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 %%% PDF {{{
52 \newif\ifpdf
53   \ifx\pdfoutput\undefined
54     \pdffalse
55   \else
56     \pdfoutput=1
57     \pdftrue
58   \fi
59
60 \ifpdfoutput{
61   \usepackage[pdftex]{graphicx}
62   \DeclareGraphicsExtensions{.pdf}
63   \pdfcompresslevel=9
64   \usepackage[%
65     pdftex=true,
66     backref=true,
67     colorlinks=true,
68     bookmarks=true,
69     breaklinks=true,
70     linktocpage=true,
71     bookmarksopen=false,
72     bookmarksnumbered=false,
73     pdfpagemode=None
74   ]{hyperref}
75 }{
76   \usepackage[dvips]{graphicx}
77   \DeclareGraphicsExtensions{.eps}
78   % \usepackage[%
79   %   dvips,
80   %   breaklinks=true,
81   %   colorlinks=false
82   % ]{hyperref}
83 }
84 %%% }}}
85 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
86
87 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
88 %%% Eigene Funktionen {{{
89 %%% Beispiel:  \bild{200pt}{foo}{That's a foo\ldots}
90 \newcommand{\bild}[3]{
91   \begin{figure}
92     \includegraphics[width=#1, keepaspectratio=true]{#2}
93     \caption{#3}
94     \label{#2}
95   \end{figure}
96 }
97
98 \newcommand{\kbd}[1]{\texttt{#1}}
99 \newcommand{\commandlistbegin}{
100   \vspace{3pt}
101   \begin{tabular}{ll}
102 }
103 \newcommand{\commandlistend}{
104   \end{tabular}
105 }
106 \newcommand{\command}[2]{
107   \texttt{#1} & \quad #2 \\
108 }
109
110 %%% }}}
111 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
112
113 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
114 %%% Pagestyle {{{
115   \pagestyle{scrheadings}
116 % \pagestyle{fancyhdrs}
117 % \pagestyle{empty}
118 %%% }}}
119 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
120
121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
122 %%% Seitenkopf- und -Fußzeilen {{{
123  \automark[subsection*]{section} % \left- und \rightmark bekommen Inhalt
124 %%% Oben: Links, Mitte, Rechts
125  \ihead[]{{\Huge GRML-Zsh-Refcard}}
126  \chead[]{}
127  \ohead[]{Generated: \today}
128 %%% Unten: Links, Mitte, Rechts
129  \ifoot[]{\vspace{-3pt}GRML-Zsh-Refcard}
130  \cfoot[]{}
131  \ofoot[]{\vspace{-3pt}\copyright 2005-2007 \href{mailto:julius@grml.org}{Julius Plenz},
132  \href{mailto:mika@grml.org}{Michael Prokop} and
133  \href{mailto:ft@bewatermyfriend.de}{Frank Terbeck}}
134 %%% }}}
135 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
136
137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
138 %%% Sonstiges {{{
139 % \setlength{\parindent}{17pt}      % Einzug 17pt,
140 % \setlength{\parskip}{2pt}         % keine Leerzeilen.
141
142 % \textwidth      127mm             % Textbreite
143 % \textheight     235mm             % Texthöhe
144 % \topmargin     -5mm               % Abstand oben
145 % \oddsidemargin  7mm               % Abstand Links, onepage
146
147 %\onehalfspacing                    % Zeilenabstand: Bei korrektur,
148  \singlespacing                     % bei Abgabe
149
150 % Punkt- und Komma Abstände bei Tausendern/
151 % Dezimalzahlen ans deutsche anpassen!
152  \mathcode`,="013B
153  \mathcode`.="613A
154
155  \setlength{\emergencystretch}{2em} % Notfallsstreckung
156 %%% }}}
157 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158
159 \addtolength{\voffset}{10pt}
160 \renewcommand{\figurename}{Abb.}
161 \begin{document}
162
163 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
164 %%% Titelseite {{{
165 %\pagenumbering{none}                % Für die Titelseite: Keine Seitennummern,
166 %\thispagestyle{empty}               % keine Kopf- und Fußzeilen.
167 %
168 %\begin{center}
169 %
170 %\end{center}
171 %\newpage
172 %
173 %%% }}}
174 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
175
176 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
177 %%% Inhaltsverzeichnis {{{
178   \pagenumbering{arabic}            % Arabische Nummerierung
179 % \pagenumbering{roman}             % Kleine, römische Nummerierung
180 % \tableofcontents                  % Das Inhaltsverzeichnis
181 % \listoffigures                    % Verzeichnis aller Abbildungen
182 % \listoftables                     % Verzeichnis aller Tabellen
183 % \pagenumbering{arabic}            % ...und wieder Arabisch
184 % \newpage
185 %%% }}}
186 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
187
188 % we won't be using math mode much, so redefine some of the characters
189 % we might want to talk about
190 \catcode`\^=12
191 \catcode`\_=12
192
193 \chardef\\=`\\
194 \chardef\{=`\{
195 \chardef\}=`\}
196
197 \parskip=0pt
198 \setlength{\tabcolsep}{0pt}
199
200 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201 %%% Inhalt {{{
202
203 %Schon in lhead
204 %\section{GRML's Zsh-Setup Reference Card}
205
206 \subsection*{Configuration files}
207
208 \small{Global zsh configuration is located in \textbf{/etc/zsh/zshrc}.  User
209 specific settings are defined in \textbf{/etc/skel/.zshrc} (which can be found
210 in \kbd{\~}/.zshrc for user grml too). Please notice that some functions/aliases
211 are not active by default for user root (referred to as '... for user (grml)'
212 below) because of security reasons. Just run 'zshskel' (as user root) to source
213 the file /etc/skel/.zshrc. Some aliases/functions also aren't active if the
214 appropriate executable isn't present on your system.
215
216 /etc/zsh/zshrc: this file can be adjusted according to your needs via using a
217 file named /etc/zsh/zshrc.local which is not part of the Debian package
218 management. So place all your changes in the file /etc/zsh/zshrc.local.  If you
219 don't have write permissions to /etc/zsh/zshrc on your own, copy the file
220 /etc/zsh/zshrc to \kbd{\~}/.zshrc.global and it will be sourced by
221 \kbd{\~}/.zshrc then.
222
223 Write important commands you always need (no matter what's inside zsh's
224 history!) to a file named \textbf{\kbd{\~}/.important\_commands}.
225
226 Notice that /etc/skel/.zshrc itself is not sourced by zsh but copied to
227 \$HOME-directory of your non-root user once. To keep your
228 \textbf{\kbd{\~}/.zshrc} in sync with upstream's development just put your
229 personal stuff into a file named \textbf{\kbd{\~}/.zshrc.local} and point your
230 \kbd{\~}/.zshrc to /etc/skel/.zshrc running 'ln -s /etc/skel/.zshrc
231 \kbd{\~}/.zshrc'.}
232
233 You can get information regarding configuration files and some environment
234 variables to adjust runtime behaviour of grml's zsh running \textbf{zsh-help}.
235
236 \subsection*{Using grml's zsh configuration on a non-grml system}
237
238 You do not have to use grml/Debian to use grml's zsh configuration.
239 Just retrieve and install the configuration files for example running:
240
241 \begin{tiny}
242 \begin{verbatim}
243 wget -O ~/.zshrc      http://hg.grml.org/grml-etc-core/raw-file/tip/etc/skel/.zshrc
244 wget -O ~/.zshrc.global http://hg.grml.org/grml-etc-core/raw-file/tip/etc/zsh/zshrc
245 \end{verbatim}
246 \end{tiny}
247
248 \subsection*{Problems?}
249
250 Please report any problems you notice using the grml zsh configuration
251 to the grml-team. The configuration has been tested on several Linux
252 Distribution (Debian, Gentoo, SuSE,...) and non-Linux systems as well
253 (FreeBSD, Solaris, AIX,...) but there might be issues anyway. Please
254 \href{http://grml.org/bugs/}{report them}!
255
256 \subsection*{Settings}
257
258 If not already defined, the variables are set to the following
259 values:
260
261 \commandlistbegin
262 @@INSERT-variables@@
263 \commandlistend
264
265 \commandlistbegin
266 \command{umask @@INSERT-other-umask@@}{new files automatically get permissions \kbd{@@INSERT-other-umaskstr@@}}
267 \command{umask @@INSERT-other-r_umask@@}{new files for root user \kbd{@@INSERT-other-r_umaskstr@@}}
268 \commandlistend
269
270 \subsection*{Keybindings}
271
272 Default keybinding mode is Emacs, i.e. you can use Emacs keybinds like
273 \kbd{^A {\rm or} ^E} on the command line. You can however also switch
274 to vi mode.
275
276 \commandlistbegin
277 \command{setopt emacs}{Switch to Emacs mode (default)}
278 \command{setopt vi}{Switch to vi mode}
279 \commandlistend
280
281 The following keybindings document some important keybindings which are not
282 defined by zsh's default configuration. Tip: press <tab> twice when completing a
283 command you installed which is not yet known to zsh or run 'rehash' manually.
284
285 \commandlistbegin
286 @@INSERT-keybindings@@
287 \commandlistend
288
289 \newpage
290
291 \subsection*{Terminal Settings}
292
293 There are 8 aliases designed to change the font size of the
294 XTerm, Aterm\ldots These are:
295 \kbd{hide},
296 \kbd{tiny},
297 \kbd{small},
298 \kbd{medium},
299 \kbd{default},
300 \kbd{large},
301 \kbd{huge},
302 \kbd{smartfont},
303 \kbd{semifont}.
304
305 \subsection*{Hashes}
306
307 Directory hashes are shortcuts for often used directories. You can
308 expand them by typing \kbd{\~{}hash}. Usage example: 'cd \kbd{\~}doc'
309
310 \commandlistbegin
311 @@INSERT-hasheddirs@@
312 \commandlistend
313
314 \subsection*{System-Wide Aliases}
315
316 \commandlistbegin
317 @@INSERT-aliases-system@@
318 \commandlistend
319
320 \subsection*{Global Functions}
321
322 \commandlistbegin
323 @@INSERT-functions-system@@
324 @@INSERT-functions-services@@
325 \commandlistend
326
327 \vspace{8pt}
328 \subsection*{Debian commands}
329
330 Notice: if not executed as root it tries to run the command via sudo if
331 necessary.
332
333 \commandlistbegin
334 @@INSERT-aliases-debian@@
335 @@INSERT-functions-debian@@
336 \commandlistend
337
338 \subsection*{Aliases for user (grml)}
339
340 \commandlistbegin
341 @@INSERT-aliases-user@@
342 \commandlistend
343
344 \subsection*{Abbreviation expansion for user (grml)}
345
346 As of version 0.9 grml does not enable global aliases anymore.  Instead, a
347 feature similiar to vim's 'iab' was added. The default key-sequence to trigger
348 the expansion is ',.'.
349
350 Example:
351
352 \commandlistbegin
353 \kbd{co}\begin{Huge},.\end{Huge} \quad expands to: \kbd{./configure \&\& make \&\& sudo make install}
354 \commandlistend
355
356 The configuration of this feature and its implementation are described in the zshwiki
357 <\url{http://zshwiki.org/home/examples/zleiab}>.
358
359 \commandlistbegin
360 @@INSERT-abbrev@@
361 %\vspace{35pt} % temporary hack for alignment of columns/rows
362 \commandlistend
363
364 \vspace{12pt}
365 Most of the normal aliases are also added to this database, so you may expand them
366 just like this as well.
367
368 %\pagebreak
369
370 \subsection*{Functions for user (grml)}
371
372 \textbf{Searching}
373
374 \commandlistbegin
375 @@INSERT-functions-search@@
376 \commandlistend
377
378 \vspace{12pt}
379 \textbf{Shortcuts}
380
381 \commandlistbegin
382 @@INSERT-functions-shortcuts@@
383 \commandlistend
384
385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386 % Dieser Trenner muss eingefügt werden, wenn eine Tabelle zu lang ist
387 % und daher nicht von LaTeX umbrochen wird.
388 %\commandlistend
389 %
390 %\commandlistbegin
391 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
392
393
394 %%% }}}
395 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
396
397 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
398 %%% Bibliographieverzeichnis {{{
399 %\newpage
400 %\nocite{*}
401 %\bibliographystyle{plaindin}
402 %\bibliography{quellen}
403 %%% }}}
404 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
405
406 \end{document}
407
408 %%% vim:set ai tw=80 fdm=marker:   EOF