Update year in the copyright footer
[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-2009 \href{mailto:julius@grml.org}{Julius Plenz},
132  \href{mailto:mika@grml.org}{Michael Prokop} and
133  \href{mailto:ft@grml.org}{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{Grml's zsh configuration is located in \textbf{/etc/zsh/zshrc}. Please
209 note that some functions/aliases are not active by default for user root
210 (referred to as '... for user (grml)' below) for of security reasons.
211 If you want your root user to use the full setup on your box, put
212 \textbf{GRML\_ALWAYS\_LOAD\_ALL=1} into root's \kbd{\~}/.zshrc.pre.
213 Some aliases/functions are not activated if the appropriate executable
214 isn't present on your system, either.
215
216 You can adjust the grml setup globally to your systems via a file
217 named /etc/zsh/zshrc.local, which is not under the control of Debian package
218 management.
219
220 Put important commands which you need on a regular basis into a file named
221 \textbf{\kbd{\~}/.important\_commands}.
222
223 You can put personal configuration for a user into a file named
224 \textbf{\kbd{\~}/.zshrc.local}. Changes you need to have sourced
225 \textbf{before} the grml zsh setup is loaded can be put into
226 \textbf{\kbd{\~}/.zshrc.pre}.
227
228 More information regarding configuration files and some environment
229 variables to adjust runtime behaviour of grml's zsh can be accessed by
230 running \textbf{zsh-help}.
231
232 \subsection*{Using grml's zsh configuration on a non-grml system}
233
234 You do not have to use grml/Debian to use grml's zsh configuration.
235 Just retrieve and install the configuration files in your home directory.
236 You can do this by running:
237
238 \begin{tiny}
239 \begin{verbatim}
240 wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
241 \end{verbatim}
242 \end{tiny}
243
244 This is \textbf{different} from earlier versions of grml's zsh setup.
245 You only use the zshrc file from /etc/zsh/ \textbf{not} the .zshrc file
246 from /etc/skel/ these days. You can remove \kbd{\~}/.zshrc.global if it is
247 still present in your home directory.
248
249 \subsection*{Problems?}
250
251 Please report any problems you encounter while using the grml zsh
252 configuration to the grml team. The configuration has been tested on several
253 Linux distributions (Debian, Gentoo, SuSE, etc) and non-Linux systems as well
254 (FreeBSD, Solaris, AIX, etc), but there might be issues, anyway.
255 \href{http://grml.org/bugs/}{Report them, please!}
256
257 \subsection*{Settings}
258
259 If not already defined, these variables are set to the following
260 values:
261
262 \commandlistbegin
263 @@INSERT-variables@@
264 \commandlistend
265
266 \commandlistbegin
267 \command{umask @@INSERT-other-umask@@}{new files automatically get permissions \kbd{@@INSERT-other-umaskstr@@}}
268 \command{umask @@INSERT-other-r_umask@@}{new files for root user \kbd{@@INSERT-other-r_umaskstr@@}}
269 \commandlistend
270
271 \subsection*{Keybindings}
272
273 Default keybinding mode is Emacs, i.e. you can use Emacs keybinds like
274 \kbd{^A {\rm or} ^E} on the command line. However, you can switch to vi
275 mode.
276
277 \commandlistbegin
278 \command{setopt emacs}{Switch to Emacs mode (default)}
279 \command{setopt vi}{Switch to vi mode}
280 \commandlistend
281
282 \vspace{8pt}
283 The following documents some important keybindings which are not
284 defined in zsh's default configuration. Hint: press <tab> twice when completing
285 a command you installed which is not yet known to zsh or run 'rehash' manually.
286
287 \commandlistbegin
288 @@INSERT-keybindings@@
289 \commandlistend
290
291 \newpage
292
293 \subsection*{Terminal Settings}
294
295 There are 8 aliases designed to change the font size of terminal
296 emulators (XTerm, Aterm, etc). They are:
297 \kbd{hide},
298 \kbd{tiny},
299 \kbd{small},
300 \kbd{medium},
301 \kbd{default},
302 \kbd{large},
303 \kbd{huge},
304 \kbd{smartfont},
305 \kbd{semifont}.
306
307 \subsection*{Hashes}
308
309 Directory hashes are shortcuts for common directories. You can
310 expand them by typing \kbd{\~{}hash}. Usage: 'cd \kbd{\~}doc'
311
312 \commandlistbegin
313 @@INSERT-hasheddirs@@
314 \commandlistend
315
316 \subsection*{System-Wide Aliases}
317
318 \commandlistbegin
319 @@INSERT-aliases-system@@
320 \commandlistend
321
322 \subsection*{Global Functions}
323
324 \commandlistbegin
325 @@INSERT-functions-system@@
326 @@INSERT-functions-services@@
327 \commandlistend
328
329 \vspace{8pt}
330 \subsection*{Debian commands}
331
332 Please note: if not executed as root, these aliases try to run the command via sudo.
333
334 \commandlistbegin
335 @@INSERT-aliases-debian@@
336 @@INSERT-functions-debian@@
337 \commandlistend
338
339 \subsection*{Aliases for user (grml)}
340
341 \commandlistbegin
342 @@INSERT-aliases-user@@
343 \commandlistend
344
345 \subsection*{Abbreviation expansion for user (grml)}
346
347 As of version 0.9, grml does not enable global aliases anymore. Instead, a
348 feature similiar to vim's 'iab' was added. The default key-sequence to trigger
349 the expansion is ',.'.
350
351 Example:
352
353 \commandlistbegin
354 \kbd{co}\begin{Huge},.\end{Huge} \quad expands to: \kbd{./configure \&\& make \&\& sudo make install}
355 \commandlistend
356
357 The configuration of this feature and its implementation are described on the zsh wiki
358 <\url{http://zshwiki.org/home/examples/zleiab}>.
359
360 \commandlistbegin
361 @@INSERT-abbrev@@
362 %\vspace{35pt} % temporary hack for alignment of columns/rows
363 \commandlistend
364
365 \vspace{12pt}
366 Most of the normal aliases are also added to this database, so you may expand them
367 like this as well.
368
369 %\pagebreak
370
371 \subsection*{Functions for user (grml)}
372
373 \textbf{Searching}
374
375 \commandlistbegin
376 @@INSERT-functions-search@@
377 \commandlistend
378
379 \vspace{12pt}
380 \textbf{Shortcuts}
381
382 \commandlistbegin
383 @@INSERT-functions-shortcuts@@
384 \commandlistend
385
386 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
387 % Dieser Trenner muss eingefügt werden, wenn eine Tabelle zu lang ist
388 % und daher nicht von LaTeX umbrochen wird.
389 %\commandlistend
390 %
391 %\commandlistbegin
392 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
393
394
395 %%% }}}
396 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
397
398 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
399 %%% Bibliographieverzeichnis {{{
400 %\newpage
401 %\nocite{*}
402 %\bibliographystyle{plaindin}
403 %\bibliography{quellen}
404 %%% }}}
405 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
406
407 \end{document}
408
409 %%% vim:set ai tw=80 fdm=marker:   EOF