imported the refcard generating code, as well as the input file for the refcard.
[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[]{Revision: Die Feb 06 20:11:16 CET 2007}
128  %\ohead[]{Revision: \today}
129 %%% Unten: Links, Mitte, Rechts
130  \ifoot[]{\vspace{-3pt}GRML-Zsh-Refcard}
131  \cfoot[]{}
132  \ofoot[]{\vspace{-3pt}\copyright 2005-2007 \href{mailto:julius@grml.org}{Julius Plenz},
133  \href{mailto:mika@grml.org}{Michael Prokop} and
134  \href{mailto:ft@bewatermyfriend.de}{Frank Terbeck}}
135 %%% }}}
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
137
138 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
139 %%% Sonstiges {{{
140 % \setlength{\parindent}{17pt}      % Einzug 17pt,
141 % \setlength{\parskip}{2pt}         % keine Leerzeilen.
142
143 % \textwidth      127mm             % Textbreite
144 % \textheight     235mm             % Texthöhe
145 % \topmargin     -5mm               % Abstand oben
146 % \oddsidemargin  7mm               % Abstand Links, onepage
147
148 %\onehalfspacing                    % Zeilenabstand: Bei korrektur,
149  \singlespacing                     % bei Abgabe
150
151 % Punkt- und Komma Abstände bei Tausendern/
152 % Dezimalzahlen ans deutsche anpassen!
153  \mathcode`,="013B
154  \mathcode`.="613A
155
156  \setlength{\emergencystretch}{2em} % Notfallsstreckung
157 %%% }}}
158 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
159
160 \addtolength{\voffset}{10pt}
161 \renewcommand{\figurename}{Abb.}
162 \begin{document}
163
164 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
165 %%% Titelseite {{{
166 %\pagenumbering{none}                % Für die Titelseite: Keine Seitennummern,
167 %\thispagestyle{empty}               % keine Kopf- und Fußzeilen.
168 %
169 %\begin{center}
170 %
171 %\end{center}
172 %\newpage
173 %
174 %%% }}}
175 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
176
177 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
178 %%% Inhaltsverzeichnis {{{
179   \pagenumbering{arabic}            % Arabische Nummerierung
180 % \pagenumbering{roman}             % Kleine, römische Nummerierung
181 % \tableofcontents                  % Das Inhaltsverzeichnis
182 % \listoffigures                    % Verzeichnis aller Abbildungen
183 % \listoftables                     % Verzeichnis aller Tabellen
184 % \pagenumbering{arabic}            % ...und wieder Arabisch
185 % \newpage
186 %%% }}}
187 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188
189 % we won't be using math mode much, so redefine some of the characters
190 % we might want to talk about
191 \catcode`\^=12
192 \catcode`\_=12
193
194 \chardef\\=`\\
195 \chardef\{=`\{
196 \chardef\}=`\}
197
198 \parskip=0pt
199 \setlength{\tabcolsep}{0pt}
200
201 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
202 %%% Inhalt {{{
203
204 %Schon in lhead
205 %\section{GRML's Zsh-Setup Reference Card}
206
207 \subsection*{Configuration files}
208
209 \small{Global zsh configuration is located in \textbf{/etc/zsh/zshrc}.  User
210 specific settings are defined in \textbf{/etc/skel/.zshrc} (which can be found
211 in \kbd{\~}/.zshrc for user grml too). Please notice that some functions/aliases
212 are not active by default for user root (referred to as '... for user (grml)'
213 below) because of security reasons. Just run 'zshskel' (as user root) to source
214 the file /etc/skel/.zshrc. Some aliases/functions also aren't active if the
215 appropriate executable isn't present on your system.
216
217 /etc/zsh/zshrc: this file can be adjusted according to your needs via using a
218 file named /etc/zsh/zshrc.local which is not part of the Debian package
219 management. So place all your changes in the file /etc/zsh/zshrc.local.  If you
220 don't have write permissions to /etc/zsh/zshrc on your own, copy the file
221 /etc/zsh/zshrc to \kbd{\~}/.zshrc.global and it will be sourced by
222 \kbd{\~}/.zshrc then.
223
224 Write important commands you always need (no matter what's inside zsh's
225 history!) to a file named \textbf{\kbd{\~}/.important\_commands}.
226
227 Notice that /etc/skel/.zshrc itself is not sourced by zsh but copied to
228 \$HOME-directory of your non-root user once. To keep your
229 \textbf{\kbd{\~}/.zshrc} in sync with upstream's development just put your
230 personal stuff into a file named \textbf{\kbd{\~}/.zshrc.local} and point your
231 \kbd{\~}/.zshrc to /etc/skel/.zshrc running 'ln -s /etc/skel/.zshrc
232 \kbd{\~}/.zshrc'.}
233
234 You can get information regarding configuration files and some environment
235 variables to adjust runtime behaviour of grml's zsh running \textbf{zsh-help}.
236
237 \subsection*{Using grml's zsh configuration on a non-grml system}
238
239 You do not have to use grml/Debian to use grml's zsh configuration.
240 Just retrieve and install the configuration files for example running:
241
242 \begin{tiny}
243 \begin{verbatim}
244 wget -O ~/.zshrc      http://hg.grml.org/grml-etc-core/raw-file/tip/etc/skel/.zshrc
245 wget -O ~/.zshrc.global http://hg.grml.org/grml-etc-core/raw-file/tip/etc/zsh/zshrc
246 \end{verbatim}
247 \end{tiny}
248
249 \subsection*{Problems?}
250
251 Please report any problems you notice using the grml zsh configuration
252 to the grml-team. The configuration has been tested on several Linux
253 Distribution (Debian, Gentoo, SuSE,...) and non-Linux systems as well
254 (FreeBSD, Solaris, AIX,...) but there might be issues anyway. Please
255 \href{http://grml.org/bugs/}{report them}!
256
257 \subsection*{Settings}
258
259 If not already defined, the 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*{Key Bindings}
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. You can however also switch
275 to vi 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 \subsection*{Keybindings}
283
284 The following keybindings document some important keybindings which are not
285 defined by zsh's default configuration. Tip: press <tab> twice when completing a
286 command you installed which is not yet known to zsh or run 'rehash' manually.
287
288 \commandlistbegin
289 @@INSERT-keybindings@@
290 \commandlistend
291
292 \newpage
293
294 \subsection*{Terminal Settings}
295
296 There are 8 aliases designed to change the font size of the
297 XTerm, Aterm\ldots These are:
298 \kbd{hide},
299 \kbd{tiny},
300 \kbd{small},
301 \kbd{medium},
302 \kbd{default},
303 \kbd{large},
304 \kbd{huge},
305 \kbd{smartfont},
306 \kbd{semifont}.
307
308 \subsection*{Hashes}
309
310 Directory hashes are shortcuts for often used directories. You can
311 expand them by typing \kbd{\~{}hash}. Usage example: 'cd \kbd{\~}doc'
312
313 \commandlistbegin
314 @@INSERT-hasheddirs@@
315 \commandlistend
316
317 \subsection*{System-Wide Aliases}
318
319 \commandlistbegin
320 @@INSERT-aliases-system@@
321 \commandlistend
322
323 \subsection*{Global Functions}
324
325 \commandlistbegin
326 @@INSERT-functions-system@@
327 @@INSERT-functions-services@@
328 \commandlistend
329
330 \vspace{8pt}
331 \subsection*{Debian commands}
332
333 Notice: if not executed as root it tries to run the command via sudo if
334 necessary.
335
336 \commandlistbegin
337 @@INSERT-aliases-debian@@
338 @@INSERT-functions-debian@@
339 \commandlistend
340
341 \subsection*{Aliases for user (grml)}
342
343 \commandlistbegin
344 @@INSERT-aliases-user@@
345 \commandlistend
346
347 \subsection*{Abbreviation expansion for user (grml)}
348
349 As of version 0.9 grml does not enable global aliases anymore.  Instead, a
350 feature similiar to vim's 'iab' was added. The default key-sequence to trigger
351 the expansion is ',.'.
352
353 Example:
354
355 \commandlistbegin
356 \kbd{co}\begin{Huge},.\end{Huge} \quad expands to: \kbd{./configure \&\& make \&\& sudo make install}
357 \commandlistend
358
359 The configuration of this feature and its implementation are described in the zshwiki
360 <\url{http://zshwiki.org/home/examples/zleiab}>.
361
362 \commandlistbegin
363 @@INSERT-abbrev@@
364 %\vspace{35pt} % temporary hack for alignment of columns/rows
365 \commandlistend
366
367 \vspace{12pt}
368 Most of the normal aliases are also added to this database, so you may expand them
369 just like this as well.
370
371 %\pagebreak
372
373 %% Global Aliases are disabled ATM.
374 %\subsection*{Global Aliases}
375 %
376 %Global Aliases are expanded {\it everywhere} on the command line, not
377 %only if they are at the first position. Example: 'cat foo bar C' is the
378 %same as running 'cat foo bar | wc -l'.
379 %
380 %\commandlistbegin
381 %\command{BG}{\kbd{\& exit}}
382 %\command{C}{\kbd{| wc -l}}
383 %\command{G}{\kbd{| grep}}
384 %\command{H}{\kbd{| head}}
385 %\command{Hl}{\kbd{-{}-help |\& less -r} \quad(display help in pager)}
386 %\command{K}{\kbd{| keep}}
387 %\command{L}{\kbd{| less}}
388 %\command{M}{\kbd{| most}}
389 %\command{N}{\kbd{\&>/dev/null} \quad(No Output)}
390 %\command{R}{\kbd{| tr A-z N-za-m} \quad(ROT13)}
391 %\command{SL}{\kbd{| sort | less}}
392 %\command{S}{\kbd{| sort}}
393 %\command{T}{\kbd{| tail}}
394 %\command{V}{\kbd{| vim -}}
395 %\commandlistend
396
397 \subsection*{Functions for user (grml)}
398
399 \textbf{Searching}
400
401 \commandlistbegin
402 @@INSERT-functions-search@@
403 \commandlistend
404
405 \vspace{12pt}
406 \textbf{Shortcuts}
407
408 \commandlistbegin
409 @@INSERT-functions-shortcuts@@
410 \commandlistend
411
412 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
413 % Dieser Trenner muss eingefügt werden, wenn eine Tabelle zu lang ist
414 % und daher nicht von LaTeX umbrochen wird.
415 %\commandlistend
416 %
417 %\commandlistbegin
418 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
419
420
421 %%% }}}
422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
423
424 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
425 %%% Bibliographieverzeichnis {{{
426 %\newpage
427 %\nocite{*}
428 %\bibliographystyle{plaindin}
429 %\bibliography{quellen}
430 %%% }}}
431 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
432
433 \end{document}
434
435 %%% vim:set ai tw=80 fdm=marker:   EOF