db236c984284e3305e9ee2f81750b080882198c5
[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 \subsection*{Keybindings}
247
248 Default keybinding mode is Emacs, i.e. you can use Emacs keybinds like
249 \kbd{^A {\rm or} ^E} on the command line. However, you can switch to vi
250 mode.
251
252 \commandlistbegin
253 \command{setopt emacs}{Switch to Emacs mode (default)}
254 \command{setopt vi}{Switch to vi mode}
255 \commandlistend
256
257 \vspace{8pt}
258 The following documents some important keybindings which are not
259 defined in zsh's default configuration. Hint: press <tab> twice when completing
260 a command you installed which is not yet known to zsh or run 'rehash' manually.
261
262 \commandlistbegin
263 @@INSERT-keybindings@@
264 \commandlistend
265
266 \newpage
267
268 \subsection*{Terminal Settings}
269
270 There are 8 aliases designed to change the font size of terminal
271 emulators (XTerm, Aterm, etc). They are:
272 \kbd{hide},
273 \kbd{tiny},
274 \kbd{small},
275 \kbd{medium},
276 \kbd{default},
277 \kbd{large},
278 \kbd{huge},
279 \kbd{smartfont},
280 \kbd{semifont}.
281
282 \subsection*{Hashes}
283
284 Directory hashes are shortcuts for common directories. You can
285 expand them by typing \kbd{\~{}hash}. Usage: 'cd \kbd{\~}doc'
286
287 \commandlistbegin
288 @@INSERT-hasheddirs@@
289 \commandlistend
290
291 \subsection*{System-Wide Aliases}
292
293 \commandlistbegin
294 @@INSERT-aliases-system@@
295 \commandlistend
296
297 \subsection*{Global Functions}
298
299 \commandlistbegin
300 @@INSERT-functions-system@@
301 @@INSERT-functions-services@@
302 \commandlistend
303
304 \vspace{8pt}
305 \subsection*{Debian commands}
306
307 Please note: if not executed as root, these aliases try to run the command via sudo.
308
309 \commandlistbegin
310 @@INSERT-aliases-debian@@
311 @@INSERT-functions-debian@@
312 \commandlistend
313
314 \subsection*{Aliases for user (grml)}
315
316 \commandlistbegin
317 @@INSERT-aliases-user@@
318 \commandlistend
319
320 \subsection*{Abbreviation expansion for user (grml)}
321
322 As of version 0.9, grml does not enable global aliases anymore. Instead, a
323 feature similiar to vim's 'iab' was added. The default key-sequence to trigger
324 the expansion is ',.'.
325
326 Example:
327
328 \commandlistbegin
329 \kbd{co}\begin{Huge},.\end{Huge} \quad expands to: \kbd{./configure \&\& make \&\& sudo make install}
330 \commandlistend
331
332 The configuration of this feature and its implementation are described on the zsh wiki
333 <\url{http://zshwiki.org/home/examples/zleiab}>.
334
335 \commandlistbegin
336 @@INSERT-abbrev@@
337 %\vspace{35pt} % temporary hack for alignment of columns/rows
338 \commandlistend
339
340 \vspace{12pt}
341 Most of the normal aliases are also added to this database, so you may expand them
342 like this as well.
343
344 %\pagebreak
345
346 \subsection*{Functions for user (grml)}
347
348 \textbf{Searching}
349
350 \commandlistbegin
351 @@INSERT-functions-search@@
352 \commandlistend
353
354 \vspace{12pt}
355 \textbf{Shortcuts}
356
357 \commandlistbegin
358 @@INSERT-functions-shortcuts@@
359 \commandlistend
360
361 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
362 % Dieser Trenner muss eingefügt werden, wenn eine Tabelle zu lang ist
363 % und daher nicht von LaTeX umbrochen wird.
364 %\commandlistend
365 %
366 %\commandlistbegin
367 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
368
369
370 %%% }}}
371 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372
373 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
374 %%% Bibliographieverzeichnis {{{
375 %\newpage
376 %\nocite{*}
377 %\bibliographystyle{plaindin}
378 %\bibliography{quellen}
379 %%% }}}
380 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
381
382 \end{document}
383
384 %%% vim:set ai tw=80 fdm=marker:   EOF