Update date
[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 \usepackage[pdftex]{graphicx}
51 \DeclareGraphicsExtensions{.pdf}
52 \pdfcompresslevel=9
53 \usepackage[%
54   pdftex=true,
55   backref=true,
56   colorlinks=true,
57   bookmarks=true,
58   breaklinks=true,
59   linktocpage=true,
60   bookmarksopen=false,
61   bookmarksnumbered=false,
62   pdfpagemode=None
63 ]{hyperref}
64 %%% }}}
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
66
67 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
68 %%% Eigene Funktionen {{{
69 %%% Beispiel:  \bild{200pt}{foo}{That's a foo\ldots}
70 \newcommand{\bild}[3]{
71   \begin{figure}
72     \includegraphics[width=#1, keepaspectratio=true]{#2}
73     \caption{#3}
74     \label{#2}
75   \end{figure}
76 }
77
78 \newcommand{\kbd}[1]{\texttt{#1}}
79 \newcommand{\commandlistbegin}{
80   \vspace{3pt}
81   \begin{tabular}{ll}
82 }
83 \newcommand{\commandlistend}{
84   \end{tabular}
85 }
86 \newcommand{\command}[2]{
87   \texttt{#1} & \quad #2 \\
88 }
89
90 %%% }}}
91 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
92
93 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
94 %%% Pagestyle {{{
95   \pagestyle{scrheadings}
96 % \pagestyle{fancyhdrs}
97 % \pagestyle{empty}
98 %%% }}}
99 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
100
101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 %%% Seitenkopf- und -Fußzeilen {{{
103  \automark[subsection*]{section} % \left- und \rightmark bekommen Inhalt
104 %%% Oben: Links, Mitte, Rechts
105  \ihead[]{{\Huge GRML-Zsh-Refcard}}
106  \chead[]{}
107  \ohead[]{Generated: \today}
108 %%% Unten: Links, Mitte, Rechts
109  \ifoot[]{\vspace{-3pt}GRML-Zsh-Refcard}
110  \cfoot[]{}
111  \ofoot[]{\vspace{-3pt}\copyright 2005-2011 \href{mailto:julius@grml.org}{Julius Plenz},
112  \href{mailto:mika@grml.org}{Michael Prokop} and
113  \href{mailto:ft@grml.org}{Frank Terbeck}}
114 %%% }}}
115 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116
117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 %%% Sonstiges {{{
119 % \setlength{\parindent}{17pt}      % Einzug 17pt,
120 % \setlength{\parskip}{2pt}         % keine Leerzeilen.
121
122 % \textwidth      127mm             % Textbreite
123 % \textheight     235mm             % Texthöhe
124 % \topmargin     -5mm               % Abstand oben
125 % \oddsidemargin  7mm               % Abstand Links, onepage
126
127 %\onehalfspacing                    % Zeilenabstand: Bei korrektur,
128  \singlespacing                     % bei Abgabe
129
130 % Punkt- und Komma Abstände bei Tausendern/
131 % Dezimalzahlen ans deutsche anpassen!
132  \mathcode`,="013B
133  \mathcode`.="613A
134
135  \setlength{\emergencystretch}{2em} % Notfallsstreckung
136 %%% }}}
137 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
138
139 \addtolength{\voffset}{10pt}
140 \renewcommand{\figurename}{Abb.}
141 \begin{document}
142
143 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
144 %%% Titelseite {{{
145 %\pagenumbering{none}                % Für die Titelseite: Keine Seitennummern,
146 %\thispagestyle{empty}               % keine Kopf- und Fußzeilen.
147 %
148 %\begin{center}
149 %
150 %\end{center}
151 %\newpage
152 %
153 %%% }}}
154 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
155
156 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
157 %%% Inhaltsverzeichnis {{{
158   \pagenumbering{arabic}            % Arabische Nummerierung
159 % \pagenumbering{roman}             % Kleine, römische Nummerierung
160 % \tableofcontents                  % Das Inhaltsverzeichnis
161 % \listoffigures                    % Verzeichnis aller Abbildungen
162 % \listoftables                     % Verzeichnis aller Tabellen
163 % \pagenumbering{arabic}            % ...und wieder Arabisch
164 % \newpage
165 %%% }}}
166 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
167
168 % we won't be using math mode much, so redefine some of the characters
169 % we might want to talk about
170 \catcode`\^=12
171 \catcode`\_=12
172
173 \chardef\\=`\\
174 \chardef\{=`\{
175 \chardef\}=`\}
176
177 \parskip=0pt
178 \setlength{\tabcolsep}{0pt}
179
180 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
181 %%% Inhalt {{{
182
183 %Schon in lhead
184 %\section{GRML's Zsh-Setup Reference Card}
185
186 \subsection*{Configuration files}
187
188 \small{Grml's zsh configuration is located in \textbf{/etc/zsh/zshrc}. Please
189 note that some functions/aliases are not active by default for user root
190 (referred to as '... for user (grml)' below) for of security reasons.
191 If you want your root user to use the full setup on your box, put
192 \textbf{GRML\_ALWAYS\_LOAD\_ALL=1} into root's \kbd{\~}/.zshrc.pre.
193 Some aliases/functions are not activated if the appropriate executable
194 isn't present on your system, either.
195
196 You can adjust the grml setup globally to your systems via a file
197 named /etc/zsh/zshrc.local, which is not under the control of Debian package
198 management.
199
200 Put important commands which you need on a regular basis into a file named
201 \textbf{\kbd{\~}/.important\_commands}.
202
203 You can put personal configuration for a user into a file named
204 \textbf{\kbd{\~}/.zshrc.local}. Changes you need to have sourced
205 \textbf{before} the grml zsh setup is loaded can be put into
206 \textbf{\kbd{\~}/.zshrc.pre}.
207
208 More information regarding configuration files and some environment
209 variables to adjust runtime behaviour of grml's zsh can be accessed by
210 running \textbf{zsh-help}.
211
212 \subsection*{Using grml's zsh configuration on a non-grml system}
213
214 You do not have to use grml/Debian to use grml's zsh configuration.
215 Just retrieve and install the configuration files in your home directory.
216 You can do this by running:
217
218 \begin{tiny}
219 \begin{verbatim}
220 wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
221 \end{verbatim}
222 \end{tiny}
223
224 This is \textbf{different} from earlier versions of grml's zsh setup.
225 You only use the zshrc file from /etc/zsh/ \textbf{not} the .zshrc file
226 from /etc/skel/ these days. You can remove \kbd{\~}/.zshrc.global if it is
227 still present in your home directory.
228
229 \subsection*{Problems?}
230
231 Please report any problems you encounter while using the grml zsh
232 configuration to the grml team. The configuration has been tested on several
233 Linux distributions (Debian, Gentoo, SuSE, etc) and non-Linux systems as well
234 (FreeBSD, Solaris, AIX, etc), but there might be issues, anyway.
235 \href{http://grml.org/bugs/}{Report them, please!}
236
237 \subsection*{Settings}
238
239 If not already defined, these variables are set to the following
240 values:
241
242 \commandlistbegin
243 @@INSERT-variables@@
244 \commandlistend
245
246 \commandlistbegin
247 \command{umask @@INSERT-other-umask@@}{new files automatically get permissions \kbd{@@INSERT-other-umaskstr@@}}
248 \command{umask @@INSERT-other-r_umask@@}{new files for root user \kbd{@@INSERT-other-r_umaskstr@@}}
249 \commandlistend
250
251 \subsection*{Keybindings}
252
253 Default keybinding mode is Emacs, i.e. you can use Emacs keybinds like
254 \kbd{^A {\rm or} ^E} on the command line. However, you can switch to vi
255 mode.
256
257 \commandlistbegin
258 \command{setopt emacs}{Switch to Emacs mode (default)}
259 \command{setopt vi}{Switch to vi mode}
260 \commandlistend
261
262 \vspace{8pt}
263 The following documents some important keybindings which are not
264 defined in zsh's default configuration. Hint: press <tab> twice when completing
265 a command you installed which is not yet known to zsh or run 'rehash' manually.
266
267 \commandlistbegin
268 @@INSERT-keybindings@@
269 \commandlistend
270
271 \newpage
272
273 \subsection*{Terminal Settings}
274
275 There are 8 aliases designed to change the font size of terminal
276 emulators (XTerm, Aterm, etc). They are:
277 \kbd{hide},
278 \kbd{tiny},
279 \kbd{small},
280 \kbd{medium},
281 \kbd{default},
282 \kbd{large},
283 \kbd{huge},
284 \kbd{smartfont},
285 \kbd{semifont}.
286
287 \subsection*{Hashes}
288
289 Directory hashes are shortcuts for common directories. You can
290 expand them by typing \kbd{\~{}hash}. Usage: 'cd \kbd{\~}doc'
291
292 \commandlistbegin
293 @@INSERT-hasheddirs@@
294 \commandlistend
295
296 \subsection*{System-Wide Aliases}
297
298 \commandlistbegin
299 @@INSERT-aliases-system@@
300 \commandlistend
301
302 \subsection*{Global Functions}
303
304 \commandlistbegin
305 @@INSERT-functions-system@@
306 @@INSERT-functions-services@@
307 \commandlistend
308
309 \vspace{8pt}
310 \subsection*{Debian commands}
311
312 Please note: if not executed as root, these aliases try to run the command via sudo.
313
314 \commandlistbegin
315 @@INSERT-aliases-debian@@
316 @@INSERT-functions-debian@@
317 \commandlistend
318
319 \subsection*{Aliases for user (grml)}
320
321 \commandlistbegin
322 @@INSERT-aliases-user@@
323 \commandlistend
324
325 \subsection*{Abbreviation expansion for user (grml)}
326
327 As of version 0.9, grml does not enable global aliases anymore. Instead, a
328 feature similiar to vim's 'iab' was added. The default key-sequence to trigger
329 the expansion is ',.'.
330
331 Example:
332
333 \commandlistbegin
334 \kbd{co}\begin{Huge},.\end{Huge} \quad expands to: \kbd{./configure \&\& make \&\& sudo make install}
335 \commandlistend
336
337 The configuration of this feature and its implementation are described on the zsh wiki
338 <\url{http://zshwiki.org/home/examples/zleiab}>.
339
340 \commandlistbegin
341 @@INSERT-abbrev@@
342 %\vspace{35pt} % temporary hack for alignment of columns/rows
343 \commandlistend
344
345 \vspace{12pt}
346 Most of the normal aliases are also added to this database, so you may expand them
347 like this as well.
348
349 %\pagebreak
350
351 \subsection*{Functions for user (grml)}
352
353 \textbf{Searching}
354
355 \commandlistbegin
356 @@INSERT-functions-search@@
357 \commandlistend
358
359 \vspace{12pt}
360 \textbf{Shortcuts}
361
362 \commandlistbegin
363 @@INSERT-functions-shortcuts@@
364 \commandlistend
365
366 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
367 % Dieser Trenner muss eingefügt werden, wenn eine Tabelle zu lang ist
368 % und daher nicht von LaTeX umbrochen wird.
369 %\commandlistend
370 %
371 %\commandlistbegin
372 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
373
374
375 %%% }}}
376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377
378 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
379 %%% Bibliographieverzeichnis {{{
380 %\newpage
381 %\nocite{*}
382 %\bibliographystyle{plaindin}
383 %\bibliography{quellen}
384 %%% }}}
385 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
386
387 \end{document}
388
389 %%% vim:set ai tw=80 fdm=marker:   EOF