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