Clarify that we no longer support i586 but require i686+
[grml.org.git] / zsh / grmlzshrc.html
1 <?xml version="1.0"
2 ?>
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml">
5 <head>
6 <title>GRMLZSHRC</title>
7 <meta name="generator" content="http://txt2tags.org" />
8 <link rel="stylesheet" type="text/css" href="t2t-modern.css" />
9 </head>
10 <body>
11 <div class="header" id="header">
12 <h1>GRMLZSHRC</h1>
13 <h3>September, 2014</h3>
14 </div>
15 <div class="body" id="body">
16 <h1>NAME</h1>
17 <p>
18 grmlzshrc - Grml's zsh setup
19 </p>
20 <h1>SYNOPSIS</h1>
21 <p>
22 <i>zsh</i> [<b>options</b>]...
23 </p>
24 <h1>DESCRIPTION</h1>
25 <p>
26 The Grml project provides a fairly exhaustive interactive setup (referred to
27 as <i>grmlzshrc</i> throughout this document) for the amazing unix shell zsh
28 (<a href="http://zsh.sourceforge.net">http://zsh.sourceforge.net</a>). This is the reference manual for that
29 setup.
30 </p>
31 <p>
32 To use <i>grmlzshrc</i>, you need at least version 3.1.7 of zsh (although not all
33 features are enabled in every version).
34 </p>
35 <p>
36 <i>grmlzshrc</i> behaves differently depending on which user loads it. For the
37 root user (<b>EUID</b> == 0) only a subset of features is loaded by default. This
38 behaviour can be altered by setting the <b>GRML_ALWAYS_LOAD_ALL</b> STARTUP
39 VARIABLE (see below).
40 </p>
41 <p>
42 Users may want to keep an up-to-date version of the setup (possibly from the
43 git-sources) in <i>~/.zshrc</i>. If that happens on a system where the global
44 zshrc is also a <i>grmlzshrc</i> (but possibly an older one), you can inhibit
45 loading the global version by doing:
46
47 </p>
48 <pre>
49 echo setopt no_global_rcs &gt;&gt; ~/.zshenv
50 </pre>
51 <p>
52 Note, that this will disable <i>ANY</i> global files, except for the global
53 zshenv file.
54 </p>
55 <h1>STARTUP VARIABLES</h1>
56 <p>
57 Some of the behaviour of <i>grmlzshrc</i> can be altered by setting certain shell
58 variables. These may be set temporarily when starting zsh like this:
59
60 </p>
61 <pre>
62 % GRML_DISPLAY_BATTERY=1 zsh
63 </pre>
64 <p>
65 Or by setting them permanently in <b>zshrc.pre</b> (See AUXILIARY FILES below).
66 </p>
67 <dl>
68 <dt><b>BATTERY</b></dt><dd>
69 Deprecated. Use <b>GRML_DISPLAY_BATTERY</b> instead.
70 <p></p>
71 </dd>
72 <dt><b>COMMAND_NOT_FOUND</b></dt><dd>
73 A non zero value activates a handler, which is called when a command can not
74 be found. The handler is defined by GRML_ZSH_CNF_HANDLER (see below).
75 <p></p>
76 </dd>
77 <dt><b>GRML_COMP_CACHING</b></dt><dd>
78 If set to <i>yes</i> (the default), the setup will enable zsh's completion caching
79 mechanism, with the caching data being placed into <i>$GRML_COMP_CACHE_DIR</i>.
80 <p></p>
81 </dd>
82 <dt><b>GRML_COMP_CACHE_DIR</b></dt><dd>
83 This defines where zsh's completion caching data will be placed, if
84 <i>$GRML_COMP_CACHING</i> is active. The default is <i>${ZDOTDIR:-$HOME}/.cache</i>.
85 The setup will ensure the directory exists before attempting to use it.
86 <p></p>
87 </dd>
88 <dt><b>GRML_DISPLAY_BATTERY</b></dt><dd>
89 If set to a value greater than zero, <i>grmlzshrc</i> will put the battery status
90 into the right hand side interactive prompt. Supported OSes are <i>GNU/Linux</i>,
91 <i>FreeBSD</i>, <i>OpenBSD</i> and <i>Darwin</i>.
92 <p></p>
93 </dd>
94 <dt><b>GRML_ZSH_CNF_HANDLER</b></dt><dd>
95 This variable contains the handler to be used by COMMAND_NOT_FOUND (see above)
96 and defaults to "/usr/share/command-not-found/command-not-found".
97 <p></p>
98 </dd>
99 <dt><b>GRML_NO_APT_ALIASES</b></dt><dd>
100 A non-empty value inhibits the definition of apt-specific short aliases,
101 such as ag, agi, ati etc.
102 <p></p>
103 </dd>
104 <dt><b>GRML_NO_SMALL_ALIASES</b></dt><dd>
105 A non-empty value inhibits the definition of 2-letter aliases such as da.
106 ls, ll, la and other common ls-related aliases are exempt from this, as are
107 the aliases inhibited by GRML_NO_APT_ALIASES.
108 <p></p>
109 </dd>
110 <dt><b>GRMLSMALL_SPECIFIC</b></dt><dd>
111 Set this to zero to remove items in zsh config, which do not work in
112 grml-small.
113 <p></p>
114 </dd>
115 <dt><b>HISTFILE</b></dt><dd>
116 Where zsh saves the history. Default: ${HOME}/.zsh_history.
117 <p></p>
118 </dd>
119 <dt><b>HISTSIZE</b></dt><dd>
120 Number of commands to be kept in the history. On a Grml-CD this defaults to
121 500, on a hard disk installation to 5000.
122 <p></p>
123 </dd>
124 <dt><b>MAILCHECK</b></dt><dd>
125 Sets the frequency in seconds for zsh to check for new mail. Defaults to 30.
126 A value of zero turns off checking.
127 <p></p>
128 </dd>
129 <dt><b>NOCOR</b></dt><dd>
130 Non zero values deactivate automatic correction of commands.
131 <p></p>
132 </dd>
133 <dt><b>NOMENU</b></dt><dd>
134 If set to zero (default), allows selection from a menu, if there are at least
135 five possible options of completion.
136 <p></p>
137 </dd>
138 <dt><b>NOPRECMD</b></dt><dd>
139 A non zero value disables precmd and preexec commands. These are functions
140 that are run before every command (setting xterm/screen titles etc.).
141 <p></p>
142 </dd>
143 <dt><b>REPORTTIME</b></dt><dd>
144 Show time (user, system and cpu) used by external commands, if they run longer
145 than the defined number of seconds (default: 5).
146 <p></p>
147 </dd>
148 <dt><b>SAVEHIST</b></dt><dd>
149 Number of commands to be stored in ${HISTFILE}. Defaults to 1000 on a Grml-CD
150 and to 10000 on an installation on hard disk.
151 <p></p>
152 </dd>
153 <dt><b>watch</b></dt><dd>
154 As in tcsh(1) an array of login/logout events to be reported by the shell
155 builtin "log". For details see zshparam(1). Defaults to (notme root).
156 <p></p>
157 </dd>
158 <dt><b>ZSH_NO_DEFAULT_LOCALE</b></dt><dd>
159 Import "/etc/default/locale", if set to zero (default).
160 <p></p>
161 </dd>
162 <dt><b>ZSH_PROFILE_RC</b></dt><dd>
163 A non zero value causes shell functions to be profiled. The results can be
164 obtained with the zprof builtin command (see zshmodules(1) for details).
165 <p></p>
166 </dd>
167 <dt><b>COMPDUMPFILE</b></dt><dd>
168 Specifies the location of the completion dump file. Default: $HOME/.zcompdump.
169 </dd>
170 </dl>
171 <h1>FEATURE DESCRIPTION</h1>
172 <p>
173 This is an in depth description of non-standard features implemented by
174 <i>grmlzshrc</i>.
175 </p>
176 <h2>DIRSTACK HANDLING</h2>
177 <p>
178 The dirstack in <i>grmlzshrc</i> has a persistent nature. It is stored into a
179 file each time zsh's working directory is changed. That file can be configured
180 via the <b>DIRSTACKFILE</b> variable and it defaults to <b>~/.zdirs</b>. The
181 <b>DIRSTACKSIZE</b> variable defaults to <b>20</b> in this setup.
182 </p>
183 <p>
184 The <b>DIRSTACKFILE</b> is loaded each time zsh starts, therefore freshly started
185 zshs inherit the dirstack of the zsh that most recently updated
186 <b>DIRSTACKFILE</b>.
187 </p>
188 <p>
189 If you would like to <i>disable</i> the persistent dirstack feature altogether,
190 you can do that by setting the boolean <i>enable</i> style to <i>false</i> in the
191 right context (the default is <i>true</i>):
192
193 </p>
194 <pre>
195 zstyle ':grml:chpwd:dirstack' enable false
196 </pre>
197 <p>
198 It is possible to apply a filter to the names of directories that will be
199 committed to the persistent dirstack file. There are two ways to configure this
200 filter: A general function based filter and a pattern based filter. Both are
201 setup via styles in the <b>':grml:chpwd:dirstack'</b> context.
202 </p>
203 <p>
204 To use a function based filter set the <i>filter</i> style for that context to the
205 name of a function to call every time a directory name is to be added to the
206 persistent dirstack. If the function's return value signals success (ie. return
207 value "0"), the directory name is filtered out and <b>not</b> added to the
208 persistent stack. Example:
209
210 </p>
211 <pre>
212 function my_dirstack_filter() { [[ $1 == /tmp(|/*) ]] }
213 zstyle ':grml:chpwd:dirstack' filter my_dirstack_filter
214 </pre>
215 <p>
216 The pattern based filter uses a list of patterns passed to the <i>exclude</i>
217 style in the aforementioned context. Each pattern is tested and the first that
218 matches will keep the directory name from being added to the persistent stack.
219 If none of the patterns matches, the name is added. example:
220
221 </p>
222 <pre>
223 zstyle ':grml:chpwd:dirstack' exclude "/tmp(|/*)" "$HOME/tmp(|/*)"
224 </pre>
225 <p>
226 The function based filter is more general, the pattern based filter easier to
227 set up. If both filter variants are used at the same time, the function based
228 filter will be executed <i>before</i> the pattern based one.
229 </p>
230 <p>
231 If you would like to apply your filters while <i>loading</i> the persistent
232 dirstack file, set the <i>filter-on-load</i> boolean style (the default is
233 <i>false</i>):
234
235 </p>
236 <pre>
237 zstyle ':grml:chpwd:dirstack' filter-on-load true
238 </pre>
239 <p>
240 Setting the <i>filter-on-load</i> and <i>enable</i> styles needs to be done in
241 ".zshrc.pre" because the styles need to be set when the main setup is
242 executing! The other styles do not have this limitation, but enabling the
243 system as well as the initial filtering will obviously be done using settings
244 and filters that are configured <b>at</b> <b>that</b> <b>point</b>.
245 </p>
246 <p>
247 With respect to <i>filter-on-load</i>, the rule of thumb is: If you want to filter
248 on load, setup everything in ".zshrc.pre" otherwise ".zshrc.local" works just
249 as well.
250 </p>
251 <h2>DIRECTORY BASED PROFILES</h2>
252 <p>
253 If you need to perform certain actions each time you enter certain
254 directory-trees, this is the feature you are looking for.
255 </p>
256 <h3>Initialisation</h3>
257 <p>
258 To initialise the system, you need to call the function `chpwd_profiles' at
259 some point in your `zshrc.local'; preferably <b>after</b> you configured the
260 system. The configuration of the system is described further below.
261 </p>
262 <p>
263 If you need to do initialisations the first time `chpwd_profiles' is called
264 (which should be in your configuration file), you can do that in a function
265 called "chpwd_profiles_init". That function needs to be defined <b>before</b>
266 `chpwd_profiles' is called for this to work.
267 </p>
268 <p>
269 During the <b>first</b> call of `chpwd_profiles' (and therefore all its profile
270 functions) the parameter `$CHPWD_PROFILES_INIT' exists and is set to `1'. In
271 all other cases, the parameter does not exist at all.
272 </p>
273 <h3>Styles and Profile-names</h3>
274 <p>
275 To store its configuration, the system uses <b>functions</b> and <b>styles</b>
276 (zsh's context sensitive configuration system), such as this:
277 </p>
278 <p>
279
280 </p>
281 <pre>
282 zstyle ':chpwd:profiles:/usr/src/grml(|/|/*)'   profile grml
283 zstyle ':chpwd:profiles:/usr/src/debian(|/|/*)' profile debian
284 </pre>
285 <p>
286 When that's done and you enter a directory that matches the pattern in the
287 third part of the context, a function called chpwd_profile_grml, for example,
288 is called (if it exists).
289 </p>
290 <p>
291 If no pattern matches (read: no profile is detected) the profile is set to
292 'default', which means chpwd_profile_default is attempted to be called.
293 </p>
294 <p>
295 A word about the context (the ':chpwd:profiles:*' stuff in the zstyle command)
296 which is used: The third part in the context is matched against ${PWD}. That's
297 why using a pattern such as /foo/bar(|/|/*) makes sense. Because that way the
298 profile is detected for all these values of ${PWD}:
299
300 </p>
301 <pre>
302   /foo/bar
303   /foo/bar/
304   /foo/bar/baz
305 </pre>
306 <p>
307 So, if you want to make double damn sure a profile works in /foo/bar and
308 everywhere deeper in that tree, just use (|/|/*) and be happy.
309 </p>
310 <p>
311 The name of the detected profile will be available in a variable called
312 'profile' in your functions. You don't need to do anything, it'll just be
313 there.
314 </p>
315 <h3>Controlling Profile Execution</h3>
316 <p>
317 During its initialisation run, the system creates a parameter $CHPWD_PROFILE,
318 which is set to the profile that was is currently active (the default value is
319 "default"). That way you can avoid running code for a profile that is already
320 active, by running code such as the following at the start of your function:
321
322 </p>
323 <pre>
324 function chpwd_profile_grml() {
325     [[ ${profile} == ${CHPWD_PROFILE} ]] &amp;&amp; return 1
326   ...
327 }
328 </pre>
329 <p>
330 If you know you are going to do that all the time for each and every
331 directory-profile function you are ever going to write, you may also set the
332 `re-execute' style to `false' (which only defaults to `true' for backwards
333 compatibility), like this:
334
335 </p>
336 <pre>
337   zstyle ':chpwd:profiles:*' re-execute false
338 </pre>
339 <h3>Signaling availabily/profile changes</h3>
340 <p>
341 If you use this feature and need to know whether it is active in your current
342 shell, there are several ways to do that. Here are two simple ways:
343 </p>
344 <p>
345 a) If knowing if the profiles feature is active when zsh starts is good
346 enough for you, you can use the following snippet:
347 </p>
348 <p>
349 (( ${+functions[chpwd_profiles]} )) &amp;&amp; print "directory profiles active"
350 </p>
351 <p>
352 b) If that is not good enough, and you would prefer to be notified whenever a
353 profile changes, you can solve that by making sure you start <b>every</b>
354 profile function you create like this:
355 </p>
356 <p>
357 function chpwd_profile_myprofilename() {
358     [[ ${profile} == ${CHPWD_PROFILE} ]] &amp;&amp; return 1
359     print "chpwd(): Switching to profile: $profile"
360   ...
361 }
362 </p>
363 <p>
364 That makes sure you only get notified if a profile is <b>changed</b>, not
365 everytime you change directory. (To avoid this, you may also set the newer
366 `re-execute' style like described further above instead of the test on top of
367 the function.
368 </p>
369 <h3>Leaving Profiles</h3>
370 <p>
371 When the system switches from one profile to another, it executes a function
372 named "chpwd_leave_profile_&lt;PREVIOUS-PROFILE-NAME&gt;()" before calling the
373 profile-function for the new profile.
374 </p>
375 <h3>Version requirement</h3>
376 <p>
377 This feature requires zsh <i>4.3.3</i> or newer.
378 </p>
379 <h2>ACCEPTLINE WRAPPER</h2>
380 <p>
381 The <i>accept-line</i> wiget is the one that is taking action when the <b>return</b>
382 key is hit. <i>grmlzshrc</i> uses a wrapper around that widget, which adds new
383 functionality.
384 </p>
385 <p>
386 This wrapper is configured via styles. That means, you issue commands, that look
387 like:
388
389 </p>
390 <pre>
391 zstyle 'context' style value
392 </pre>
393 <p>
394 The context namespace, that we are using is 'acceptline'. That means, the actual
395 context for your commands look like: <b>':acceptline:&lt;subcontext&gt;'</b>.
396 </p>
397 <p>
398 Where <b>&lt;subcontext&gt;</b> is one of: <b>default</b>, <b>normal</b>, <b>force</b>, <b>misc</b>
399 or <b>empty</b>.
400 </p>
401 <h3>Recognized Contexts</h3>
402 <dl>
403 <dt><b>default</b></dt><dd>
404 This is the value, the context is initialized with.
405 The <i>compwarnfmt and //rehash</i> styles are looked up in this context.
406 <p></p>
407 </dd>
408 <dt><b>normal</b></dt><dd>
409 If the first word in the command line is either a command, alias, function,
410 builtin or reserved word, you are in this context.
411 <p></p>
412 </dd>
413 <dt><b>force</b></dt><dd>
414 This is the context, that is used if you hit enter again, after being warned
415 about the existence of a _completion for the non-existing command you
416 entered.
417 <p></p>
418 </dd>
419 <dt><b>empty</b></dt><dd>
420 This is the context, you are in if the command line is empty or only
421 consists of whitespace.
422 <p></p>
423 </dd>
424 <dt><b>misc</b></dt><dd>
425 This context is in effect, if you entered something that does not match any
426 of the above. (e.g.: variable assignments).
427 </dd>
428 </dl>
429 <h3>Available Styles</h3>
430 <dl>
431 <dt><b>nocompwarn</b></dt><dd>
432 If you set this style to true, the warning about non existent commands,
433 for which completions exist will not be issued. (Default: <b>false</b>)
434 <p></p>
435 </dd>
436 <dt><b>compwarnfmt</b></dt><dd>
437 The message, that is displayed to warn about the _completion issue.
438 (default: <b>'%c will not execute and completion %f exists.'</b>)
439 '%c' is replaced by the command name, '%f' by the completion's name.
440 <p></p>
441 </dd>
442 <dt><b>rehash</b></dt><dd>
443 If this is set, we'll force rehashing, if appropriate. (Defaults to
444 <b>true</b> in <i>grmlzshrc</i>).
445 <p></p>
446 </dd>
447 <dt><b>actions</b></dt><dd>
448 This can be a list of wigdets to call in a given context. If you need a
449 specific order for these to be called, name them accordingly. The default value
450 is an <b>empty list</b>.
451 <p></p>
452 </dd>
453 <dt><b>default_action</b></dt><dd>
454 The name of a widget, that is called after the widgets from 'actions'.
455 By default, this will be '.accept-line' (which is the built-in accept-line
456 widget).
457 <p></p>
458 </dd>
459 <dt><b>call_default</b></dt><dd>
460 If true in the current context, call the widget in the 'default_action'
461 style. (The default is <b>true</b> in all contexts.)
462 </dd>
463 </dl>
464 <h2>PROMPT</h2>
465 <p>
466 The <i>grmlzshrc</i> now supplies three prompt themes compatible with zsh's
467 <b>promptinit</b> system. The three themes are called <b>grml</b>, <b>grml-large</b> and
468 <b>grml-chroot</b>.
469 </p>
470 <p>
471 By default, <b>grml</b> is used, unless <i>$GRMLPROMPT</i> is set to a value larger
472 than zero, in which case <b>grml-large</b> is used. Lastly, if <i>$GRML_CHROOT</i> is
473 non-empty, <b>grml-chroot</b> is used.
474 </p>
475 <p>
476 As usual, with promptinit themes, the user may switch to a different theme using
477 the <i>prompt</i> utility:
478
479 </p>
480 <pre>
481     prompt grml-large
482 </pre>
483 <p>
484 That will use the <b>grml-large</b> prompt theme.
485 </p>
486 <p>
487 The themes are highly customisable. The main source of documentation about
488 customisation is the main <b>grml</b> theme's doc-string, that is available via
489 the following command:
490
491 </p>
492 <pre>
493     prompt -h grml
494 </pre>
495 <p>
496 The other themes also come with doc-strings, but the main theme's is the
497 canonical reference about all of them.
498 </p>
499 <p>
500 This feature requires version <i>4.3.7</i> of the shell. Older versions will use
501 the classic grml prompt as a fallback.
502 </p>
503 <p>
504 A note to people who like customisation: If you are <b>not</b> using a prompt
505 theme for your customisation, but you're either statically setting $PS1 (or
506 $PROMPT) or you're constructing one of those variables in zsh's \`precmd()'
507 function, make sure you are turning the zsh's prompt theme system <b>off</b>
508 before doing so. A correct example customisation could look like this:
509
510 </p>
511 <pre>
512     # Turn the prompt system off:
513     prompt off
514     # Customise the prompt yourself:
515     PS1='%~ %# '
516 </pre>
517 <p>
518 You also add your own tokens by using the \`grml_theme_add_token()' function.
519 Call the function without arguments for detailed documentation about that
520 procedure.
521 </p>
522 <h2>GNU/SCREEN STATUS SETTING</h2>
523 <p>
524 <i>grmlzshrc</i> sets screen's hardstatus lines to the currently running command
525 or <b>'zsh'</b> if the shell is idling at its prompt. If the current working
526 directory is inside a repository unter version control, screen status is set
527 to: <b>'zsh: &lt;repository name&gt;'</b> via zsh's vcs_info.
528 </p>
529 <h2>PERSISTENT HISTORY</h2>
530 <p>
531 If you got commands you consider important enough to be included in every
532 shell's history, you can put them into $GRML_IMPORTANT_COMMANDS (which defaults
533 for backward compatibility to ~/.important_commands) and they will be available
534 via the usual history lookup widgets.
535 </p>
536 <h1>REFERENCE</h1>
537 <h2>ENVIRONMENT VARIABLES</h2>
538 <p>
539 <i>grmlzshrc</i> sets some environment variables, which influence the
540 behaviour of applications.
541 </p>
542 <dl>
543 <dt><b>COLORTERM</b></dt><dd>
544 Set to "yes". Some applications read this to learn about properties
545 of the terminal they are running in.
546 <p></p>
547 </dd>
548 <dt><b>EDITOR</b></dt><dd>
549 If not already set, sets the default editor. Falls back to vi(1),
550 if vim(1) is not available.
551 <p></p>
552 </dd>
553 <dt><b>LESS_TERMCAP_*</b></dt><dd>
554 Some environment variables that add colour support to less(1) for viewing
555 man pages. See termcap(5) for details.
556 <p></p>
557 </dd>
558 <dt><b>MAIL</b></dt><dd>
559 The mailbox file for the current user is set to /var/mail/$USER, if not
560 already set otherwise.
561 <p></p>
562 </dd>
563 <dt><b>PAGER</b></dt><dd>
564 Set less(1) as default pager, if not already set to something different.
565 </dd>
566 </dl>
567 <h2>OPTIONS</h2>
568 <p>
569 Apart from zsh's default options, <i>grmlzshrc</i> sets some options
570 that change the behaviour of zsh. Options that change Z-shell's default
571 settings are marked by &lt;grml&gt;. But note, that zsh's defaults vary depending
572 on its emulation mode (csh, ksh, sh, or zsh). For details, see zshoptions(1).
573 </p>
574 <dl>
575 <dt><b>append_history</b></dt><dd>
576 Zsh sessions, that use <i>grmlzshrc</i>, will append their history list to the
577 history file, rather than replace it. Thus, multiple parallel zsh sessions
578 will all have the new entries from their history lists added to the history
579 file, in the order that they exit. The file will still be periodically
580 re-written to trim it when the number of lines grows 20% beyond the value
581 specified by $SAVEHIST.
582 <p></p>
583 </dd>
584 <dt><b>auto_cd</b> &lt;grml&gt;</dt><dd>
585 If a command is issued that can't be executed as a normal command, and the
586 command is the name of a directory, perform the cd command to that directory.
587 <p></p>
588 </dd>
589 <dt><b>auto_pushd</b> &lt;grml&gt;</dt><dd>
590 Make cd push the old directory onto the directory stack.
591 <p></p>
592 </dd>
593 <dt><b>completeinword</b> &lt;grml&gt;</dt><dd>
594 If the cursor is inside a word, completion is done from both ends;
595 instead of moving the cursor to the end of the word first and starting
596 from there.
597 <p></p>
598 </dd>
599 <dt><b>extended_glob</b> &lt;grml&gt;</dt><dd>
600 Treat the '#', '~' and '^' characters as active globbing pattern characters.
601 <p></p>
602 </dd>
603 <dt><b>extended_history</b> &lt;grml&gt;</dt><dd>
604 Save each command's beginning timestamp (in seconds since the epoch) and the
605 duration (in seconds) to the history file.
606 <p></p>
607 </dd>
608 <dt><b>hash_list_all</b></dt><dd>
609 Whenever a command completion is attempted, make sure the entire command
610 path is hashed first. This makes the first completion slower.
611 <p></p>
612 </dd>
613 <dt><b>histignorealldups</b> &lt;grml&gt;</dt><dd>
614 If a new command line being added to the history list duplicates an
615 older one, the older command is removed from the list, even if it is
616 not the previous event.
617 <p></p>
618 </dd>
619 <dt><b>histignorespace</b> &lt;grml&gt;</dt><dd>
620 Remove command lines from the history list when the first character on
621 the line is a space, or when one of the expanded aliases contains a
622 leading space. Note that the command lingers in the internal history
623 until the next command is entered before it vanishes.
624 <p></p>
625 </dd>
626 <dt><b>longlistjobs</b> &lt;grml&gt;</dt><dd>
627 List jobs in long format by default.
628 <p></p>
629 </dd>
630 <dt><b>nobeep</b> &lt;grml&gt;</dt><dd>
631 Avoid to beep on errors in zsh command line editing (zle).
632 <p></p>
633 </dd>
634 <dt><b>noglobdots</b></dt><dd>
635 A wildcard character never matches a leading '.'.
636 <p></p>
637 </dd>
638 <dt><b>nohup</b> &lt;grml&gt;</dt><dd>
639 Do not send the hangup signal (HUP:1) to running jobs when the shell exits.
640 <p></p>
641 </dd>
642 <dt><b>nonomatch</b> &lt;grml&gt;</dt><dd>
643 If a pattern for filename generation has no matches, do not print an error
644 and leave it unchanged in the argument list. This also applies to file
645 expansion of an initial `~' or `='.
646 <p></p>
647 </dd>
648 <dt><b>notify</b></dt><dd>
649 Report the status of background jobs immediately, rather than waiting until
650 just before printing a prompt.
651 <p></p>
652 </dd>
653 <dt><b>pushd_ignore_dups</b> &lt;grml&gt;</dt><dd>
654 Don't push multiple copies of the same directory onto the directory stack.
655 <p></p>
656 </dd>
657 <dt><b>share_history</b> &lt;grml&gt;</dt><dd>
658 As each line is added to the history file, it is checked to see if anything
659 else was written out by another shell, and if so it is included in the
660 history of the current shell too. Using !-style history, the commands from
661 the other sessions will not appear in the history list unless you explicitly
662 type the "history" command. This option is activated for zsh versions &gt;= 4,
663 only.
664 </dd>
665 </dl>
666 <h2>KEYBINDINGS</h2>
667 <p>
668 Apart from zsh's default key bindings, <i>grmlzshrc</i> comes with its own set of
669 key bindings. Note that bindings like <b>ESC-e</b> can also be typed as <b>ALT-e</b>
670 on PC keyboards.
671 </p>
672 <dl>
673 <dt><b>ESC-e</b></dt><dd>
674 Edit the current command buffer in your favourite editor.
675 <p></p>
676 </dd>
677 <dt><b>ESC-v</b></dt><dd>
678 Deletes a word left of the cursor; seeing '/' as additional word separator.
679 <p></p>
680 </dd>
681 <dt><b>CTRL-x-1</b></dt><dd>
682 Jump right after the first word.
683 <p></p>
684 </dd>
685 <dt><b>CTRL-x-M()</b></dt><dd>
686 Create directory under cursor or the selected area.
687 To select an area press ctrl-@ and use the cursor.
688 Use case: you type "mv abc ~/testa/testb/testc/" and remember that the
689 directory does not exist yet -&gt; press <b>CTRL-xM</b> and problem solved.
690 <p></p>
691 </dd>
692 <dt><b>CTRL-x-p</b></dt><dd>
693 Searches the last occurence of string before the cursor in the command history.
694 <p></p>
695 </dd>
696 <dt><b>CTRL-x-z</b></dt><dd>
697 Display help on keybindings and zsh line editor. Press consecutively to page through content.
698 <p></p>
699 </dd>
700 <dt><b>CTRL-z</b></dt><dd>
701 Brings a job, which got suspended with CTRL-z back to foreground.
702 </dd>
703 </dl>
704 <h3>Customisation</h3>
705 <p>
706 To customise keybindings, you can just use zsh's bindkey utility. However, if
707 you plan to to use the `<i>zle-line-init</i>' or `<i>zle-line-finish</i>' hooks
708 yourself, make sure you call the following functions in the respective hook:
709 </p>
710 <ul>
711 <li><b>zle-line-init</b>: <i>zle-smkx</i>
712 </li>
713 <li><b>zle-line-finish</b>: <i>zle-rmkx</i>
714 </li>
715 </ul>
716 <p>
717 This is <b>required</b> so the keybindings set up by <i>grmlzshrc</i> work. The
718 reason for this is to turn the terminal into the right mode while zsh's line
719 editor (zle) is running. This enables us to query <i>terminfo</i> about escape
720 sequences for special keys and thus simplify and generalise our keybinding
721 section.
722 </p>
723 <h2>SHELL FUNCTIONS</h2>
724 <p>
725 <i>grmlzshrc</i> comes with a wide array of defined shell functions to ease the
726 user's life.
727 </p>
728 <dl>
729 <dt><b>855resolution()</b></dt><dd>
730 If 915resolution is available, issues a warning to the user to run it instead
731 to modify the resolution on intel graphics chipsets.
732 <p></p>
733 </dd>
734 <dt><b>accessed()</b></dt><dd>
735 Lists files in current directory, which have been accessed within the
736 last N days. N is an integer to be passed as first and only argument.
737 If no argument is specified N is set to 1.
738 <p></p>
739 </dd>
740 <dt><b>any()</b></dt><dd>
741 Lists processes matching given pattern.
742 <p></p>
743 </dd>
744 <dt><b>asc()</b></dt><dd>
745 Login on the host provided as argument using autossh. Then reattach a GNU screen
746 session if a detached session is around or detach a currently attached screen or
747 else start a new screen.  This is especially useful for roadwarriors using GNU
748 screen and ssh.
749 <p></p>
750 </dd>
751 <dt><b>bk()</b></dt><dd>
752 Simple backup management of a file or directory using standard unix programs.
753 The target file name is the original name plus a time stamp attached. Symlinks
754 and file attributes like mode, ownership and timestamps are preserved.
755 <p></p>
756 </dd>
757 <dt><b>cdrecord()</b></dt><dd>
758 If the original cdrecord is not installed, issues a warning to the user to
759 use the wodim binary instead. Wodim is the debian fork of Joerg Schillings
760 cdrecord.
761 <p></p>
762 </dd>
763 <dt><b>cdt()</b></dt><dd>
764 Creates a temporary directory using mktemp. Then changes current
765 working directory to it.
766 <p></p>
767 </dd>
768 <dt><b>changed()</b></dt><dd>
769 Lists files in current directory, which have been changed within the
770 last N days. N is an integer to be passed as first and only argument.
771 If no argument is specified N is set to 1.
772 <p></p>
773 </dd>
774 <dt><b>check_com()</b></dt><dd>
775 Returns true if given command exists either as program, function, alias,
776 builtin or reserved word. If the option -c is given, only returns true,
777 if command is a program.
778 <p></p>
779 </dd>
780 <dt><b>checkhome()</b></dt><dd>
781 Changes directory to $HOME on first invocation of zsh. This is necessary on
782 Grml systems with autologin.
783 <p></p>
784 </dd>
785 <dt><b>cl()</b></dt><dd>
786 Changes current directory to the one supplied by argument and lists the files
787 in it, including file names starting with ".".
788 <p></p>
789 </dd>
790 <dt><b>dchange()</b></dt><dd>
791 Shows the changelog of given package in $PAGER.
792 <p></p>
793 </dd>
794 <dt><b>dcopyright()</b></dt><dd>
795 Shows the copyright of given package in $PAGER.
796 <p></p>
797 </dd>
798 <dt><b>debian2hd()</b></dt><dd>
799 Tells the user to use grml-debootstrap, if she wants to install debian to
800 harddisk.
801 <p></p>
802 </dd>
803 <dt><b>deswap()</b></dt><dd>
804 A trick from $LINUX-KERNELSOURCE/Documentation/power/swsusp.txt. It brings
805 back interactive responsiveness after suspend, when the system is swapping
806 heavily.
807 <p></p>
808 </dd>
809 <dt><b>dnews()</b></dt><dd>
810 Shows the NEWS file for the given package in $PAGER.
811 <p></p>
812 </dd>
813 <dt><b>edalias()</b></dt><dd>
814 Edit given alias.
815 <p></p>
816 </dd>
817 <dt><b>edfunc()</b></dt><dd>
818 Edit given shell function.
819 <p></p>
820 </dd>
821 <dt><b>freload()</b></dt><dd>
822 Reloads an autoloadable shell function (See autoload in zshbuiltins(1)).
823 <p></p>
824 </dd>
825 <dt><b>grml_vcs_info_toggle_colour()</b></dt><dd>
826 Toggles between coloured and uncoloured formats in vcs_info configuration.
827 This is useful with prompts that break if colour codes are in vcs_info
828 format expansions (like the `clint' prompt and every other prompt that
829 uses %v to expand the contents of `$vcs_into_msg_0_'). If you are using
830 customised vcs_info formats, you shouldn't be using this function, since
831 it will set all formats to grml's default values (either coloured or plain)
832 again.
833 <p></p>
834 </dd>
835 <dt><b>hgdi()</b></dt><dd>
836 Use GNU diff with options -ubwd for mercurial.
837 <p></p>
838 </dd>
839 <dt><b>hgstat()</b></dt><dd>
840 Displays diffstat between the revision given as argument and tip (no
841 argument means last revision).
842 <p></p>
843 </dd>
844 <dt><b>hidiff()</b></dt><dd>
845 Outputs highlighted diff; needs highstring(1).
846 <p></p>
847 </dd>
848 <dt><b>is4()</b></dt><dd>
849 Returns true, if zsh version is equal or greater than 4, else false.
850 <p></p>
851 </dd>
852 <dt><b>is41()</b></dt><dd>
853 Returns true, if zsh version is equal or greater than 4.1, else false.
854 <p></p>
855 </dd>
856 <dt><b>is42()</b></dt><dd>
857 Returns true, if zsh version is equal or greater than 4.2, else false.
858 <p></p>
859 </dd>
860 <dt><b>is425()</b></dt><dd>
861 Returns true, if zsh version is equal or greater than 4.2.5, else false.
862 <p></p>
863 </dd>
864 <dt><b>is43()</b></dt><dd>
865 Returns true, if zsh version is equal or greater than 4.3, else false.
866 <p></p>
867 </dd>
868 <dt><b>is433()</b></dt><dd>
869 Returns true, if zsh version is equal or greater than 4.3.3, else false.
870 <p></p>
871 </dd>
872 <dt><b>isdarwin()</b></dt><dd>
873 Returns true, if running on darwin, else false.
874 <p></p>
875 </dd>
876 <dt><b>isfreebsd()</b></dt><dd>
877 Returns true, if running on FreeBSD, else false.
878 <p></p>
879 </dd>
880 <dt><b>isgrml()</b></dt><dd>
881 Returns true, if running on a grml system, else false.
882 <p></p>
883 </dd>
884 <dt><b>isgrmlcd()</b></dt><dd>
885 Returns true, if running on a grml system from a live cd, else false.
886 <p></p>
887 </dd>
888 <dt><b>isgrmlsmall()</b></dt><dd>
889 Returns true, if run on grml-small, else false.
890 <p></p>
891 </dd>
892 <dt><b>islinux()</b></dt><dd>
893 Returns true, if running on Linux, else false.
894 <p></p>
895 </dd>
896 <dt><b>iso2utf()</b></dt><dd>
897 Changes every occurrence of the string iso885915 or ISO885915 in
898 environment variables to UTF-8.
899 <p></p>
900 </dd>
901 <dt><b>isopenbsd()</b></dt><dd>
902 Returns true, if running on OpenBSD, else false.
903 <p></p>
904 </dd>
905 <dt><b>isutfenv()</b></dt><dd>
906 Returns true, if run within an utf environment, else false.
907 <p></p>
908 </dd>
909 <dt><b>mkcd()</b></dt><dd>
910 Creates directory including parent directories, if necessary. Then changes
911 current working directory to it.
912 <p></p>
913 </dd>
914 <dt><b>modified()</b></dt><dd>
915 Lists files in current directory, which have been modified within the
916 last N days. N is an integer to be passed as first and only argument.
917 If no argument is specified N is set to 1.
918 <p></p>
919 </dd>
920 <dt><b>nt()</b></dt><dd>
921 A helper function for the "e" glob qualifier to list all files newer
922 than a reference file.
923
924 Example usages:
925 <pre>
926 % NTREF=/reference/file
927 % ls -l *(e:nt:)
928 % # Inline:
929 % ls -l *(e:'nt /reference/file':)
930 </pre>
931 <p></p>
932 </dd>
933 <dt><b>profile()</b></dt><dd>
934 Runs a command in zsh with profiling enabled (See startup variable
935 ZSH_PROFILE_RC above).
936 <p></p>
937 </dd>
938 <dt><b>salias()</b></dt><dd>
939 Creates an alias whith sudo prepended, if $EUID is not zero. Run "salias -h"
940 for details. See also xunfunction() below.
941 <p></p>
942 </dd>
943 <dt><b>simple-extract()</b></dt><dd>
944 Tries to uncompress/unpack given files with the appropriate programs. If an URI
945 starting with https, http or ftp is provided simple-extract tries to download
946 and then uncompress/unpack the file. The choice is made along the filename
947 ending. simple-extract will not delete the original archive (even on .gz,.bz2 or
948 .xz) unless you use the '-d' option.
949 <p></p>
950 </dd>
951 <dt><b>sll()</b></dt><dd>
952 Prints details of symlinks given as arguments.
953 <p></p>
954 </dd>
955 <dt><b>ssl-cert-fingerprints</b></dt><dd>
956 Prints the SHA512, SHA256, SHA1 and MD5 digest of a x509 certificate.
957 First and only parameter must be a file containing a certificate. Use
958 /dev/stdin as file if you want to pipe a certificate to these
959 functions.
960 <p></p>
961 </dd>
962 <dt><b>ssl-cert-info</b></dt><dd>
963 Prints all information of a x509 certificate including the SHA512,
964 SHA256, SHA1 and MD5 digests. First and only parameter must be a file
965 containing a certificate. Use /dev/stdin as file if you want to pipe a
966 certificate to this function.
967 <p></p>
968 </dd>
969 <dt><b>ssl-cert-sha512(), ssl-cert-sha256(), ssl-cert-sha1(), ssl-cert-md5()</b></dt><dd>
970 Prints the SHA512, SHA256, SHA1 respective MD5 digest of a x509
971 certificate. First and only parameter must be a file containing a
972 certificate. Use /dev/stdin as file if you want to pipe a certificate
973 to this function.
974 <p></p>
975 </dd>
976 <dt><b>Start(), Restart(), Stop(), Force-Reload(), Reload()</b></dt><dd>
977 Functions for controlling daemons.
978 <pre>
979 Example usage:
980 % Restart ssh
981 </pre>
982 <p></p>
983 </dd>
984 <dt><b>trans()</b></dt><dd>
985 Translates a word from german to english (-D) or vice versa (-E).
986 <p></p>
987 </dd>
988 <dt><b>uchange()</b></dt><dd>
989 Shows upstreams changelog of a given package in $PAGER.
990 <p></p>
991 </dd>
992 <dt><b>uprint()</b></dt><dd>
993 Works around the "print -l ${(u)foo}"-limitation on zsh older than 4.2.
994 <p></p>
995 </dd>
996 <dt><b>utf2iso()</b></dt><dd>
997 Changes every occurrence of the string UTF-8 or utf-8 in environment
998 variables to iso885915.
999 <p></p>
1000 </dd>
1001 <dt><b>vim()</b></dt><dd>
1002 Wrapper for vim(1). It tries to set the title and hands vim the environment
1003 variable VIM_OPTIONS on the command line. So the user may define command
1004 line options, she always wants, in her .zshrc.local.
1005 <p></p>
1006 </dd>
1007 <dt><b>whatwhen()</b></dt><dd>
1008 Searches the history for a given pattern and lists the results by date.
1009 The first argument is the search pattern. The second and third ones are
1010 optional and denote a search range (default: -100).
1011 <p></p>
1012 </dd>
1013 <dt><b>xcat()</b></dt><dd>
1014 Tries to cat(1) file(s) given as parameter(s). Always returns true.
1015 See also xunfunction() below.
1016 <p></p>
1017 </dd>
1018 <dt><b>xsource()</b></dt><dd>
1019 Tries to source the file(s) given as parameter(s). Always returns true.
1020 See zshbuiltins(1) for a detailed description of the source command.
1021 See also xunfunction() below.
1022 <p></p>
1023 </dd>
1024 <dt><b>xtrename()</b></dt><dd>
1025 Changes the title of xterm window from within screen(1). Run without
1026 arguments for details.
1027 <p></p>
1028 </dd>
1029 <dt><b>xunfunction()</b></dt><dd>
1030 Removes the functions salias, xcat, xsource, xunfunction and zrcautoload.
1031 <p></p>
1032 </dd>
1033 <dt><b>zrcautoload()</b></dt><dd>
1034 Wrapper around the autoload builtin. Loads the definitions of functions
1035 from the file given as argument. Searches $fpath for the file. See also
1036 xunfunction() above.
1037 <p></p>
1038 </dd>
1039 <dt><b>zrclocal()</b></dt><dd>
1040 Sources /etc/zsh/zshrc.local and ${HOME}/.zshrc.local. These are the files
1041 where own modifications should go. See also zshbuiltins(1) for a description
1042 of the source command.
1043 </dd>
1044 </dl>
1045 <h2>ALIASES</h2>
1046 <p>
1047 <i>grmlzshrc</i> comes with a wide array of predefined aliases to ease the user's
1048 life. A few aliases (like those involving <i>grep</i> or <i>ls</i>) use the option
1049 <i>--color=auto</i> for colourizing output. That option is part of <b>GNU</b>
1050 implementations of these tools, and will only be used if such an implementation
1051 is detected.
1052 </p>
1053 <dl>
1054 <dt><b>acp</b> (<i>apt-cache policy</i>)</dt><dd>
1055 With no arguments prints out the priorities of each source. If a package name
1056 is given, it displays detailed information about the priority selection of the
1057 package.
1058 <p></p>
1059 </dd>
1060 <dt><b>acs</b> (<i>apt-cache search</i>)</dt><dd>
1061 Searches debian package lists for the regular expression provided as argument.
1062 The search includes package names and descriptions. Prints out name and short
1063 description of matching packages.
1064 <p></p>
1065 </dd>
1066 <dt><b>acsh</b> (<i>apt-cache show</i>)</dt><dd>
1067 Shows the package records for the packages provided as arguments.
1068 <p></p>
1069 </dd>
1070 <dt><b>adg</b> (<i>apt-get dist-upgrade</i>)</dt><dd>
1071 Performs an upgrade of all installed packages. Also tries to automatically
1072 handle changing dependencies with new versions of packages. As this may change
1073 the install status of (or even remove) installed packages, it is potentially
1074 dangerous to use dist-upgrade; invoked by sudo, if necessary.
1075 <p></p>
1076 </dd>
1077 <dt><b>ag</b> (<i>apt-get upgrade</i>)</dt><dd>
1078 Downloads and installs the newest versions of all packages currently installed
1079 on the system. Under no circumstances are currently installed packages removed,
1080 or packages not already installed retrieved and installed. New versions of
1081 currently installed packages that cannot be upgraded without changing the install
1082 status of another package will be left at their current version. An update must
1083 be performed first (see au below); run by sudo, if necessary.
1084 <p></p>
1085 </dd>
1086 <dt><b>agi</b> (<i>apt-get install</i>)</dt><dd>
1087 Downloads and installs or upgrades the packages given on the command line.
1088 If a hyphen is appended to the package name, the identified package will be
1089 removed if it is installed. Similarly a plus sign can be used to designate a
1090 package to install. This may be useful to override decisions made by apt-get's
1091 conflict resolution system.
1092 A specific version of a package can be selected for installation by following
1093 the package name with an equals and the version of the package to select. This
1094 will cause that version to be located and selected for install. Alternatively a
1095 specific distribution can be selected by following the package name with a slash
1096 and the version of the distribution or the Archive name (stable, testing, unstable).
1097 Gets invoked by sudo, if user id is not 0.
1098 <p></p>
1099 </dd>
1100 <dt><b>ati</b> (<i>aptitude install</i>)</dt><dd>
1101 Aptitude is a terminal-based package manager with a command line mode similar to
1102 apt-get (see agi above); invoked by sudo, if necessary.
1103 <p></p>
1104 </dd>
1105 <dt><b>au</b> (<i>apt-get update</i>)</dt><dd>
1106 Resynchronizes the package index files from their sources. The indexes of
1107 available packages are fetched from the location(s) specified in
1108 /etc/apt/sources.list. An update should always be performed before an
1109 upgrade or dist-upgrade; run by sudo, if necessary.
1110 <p></p>
1111 </dd>
1112 <dt><b>da</b> (<i>du -sch</i>)</dt><dd>
1113 Prints the summarized disk usage of the arguments as well as a grand total
1114 in human readable format.
1115 <p></p>
1116 </dd>
1117 <dt><b>dbp</b> (<i>dpkg-buildpackage</i>)</dt><dd>
1118 Builds binary or source packages from sources (See: dpkg-buildpackage(1)).
1119 <p></p>
1120 </dd>
1121 <dt><b>debs-by-size</b> (<i>grep-status -FStatus -sInstalled-Size,Package -n "install ok installed" | paste -sd "  \n" | sort -rn</i>)</dt><dd>
1122 Prints installed Packages sorted by size (descending).
1123 <p></p>
1124 </dd>
1125 <dt><b>dir</b> (<i>ls -lSrah</i>)</dt><dd>
1126 Lists files (including dot files) sorted by size (biggest last) in long and
1127 human readable output format.
1128 <p></p>
1129 </dd>
1130 <dt><b>ge</b> (<i>grep-excuses</i>)</dt><dd>
1131 Searches the testing excuses files for a specific maintainer (See:
1132 grep-excuses(1)).
1133 <p></p>
1134 </dd>
1135 <dt><b>grep</b> (<i>grep --color=auto</i>)</dt><dd>
1136 Shows grep output in nice colors, if available.
1137 <p></p>
1138 </dd>
1139 <dt><b>grml-version</b> (<i>cat /etc/grml_version</i>)</dt><dd>
1140 Prints version of running grml.
1141 <p></p>
1142 </dd>
1143 <dt><b>hbp</b> (<i>hg-buildpackage</i>)</dt><dd>
1144 Helper program to maintain Debian packages with mercurial.
1145 <p></p>
1146 </dd>
1147 <dt><b>http</b> (<i>python -m SimpleHTTPServer</i>)</dt><dd>
1148 Basic HTTP server implemented in python. Listens on port 8000/tcp and
1149 serves current directory. Implements GET and HEAD methods.
1150 <p></p>
1151 </dd>
1152 <dt><b>insecscp</b> (<i>scp -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"</i>)</dt><dd>
1153 scp with possible man-in-the-middle attack enabled. This is convenient, if the targets
1154 host key changes frequently, for example on virtualized test- or development-systems.
1155 To be used only inside trusted networks, of course.
1156 <p></p>
1157 </dd>
1158 <dt><b>insecssh</b> (<i>ssh -o "StrictHostKeyChecking=no" -o "UserKnownHostsFile=/dev/null"</i>)</dt><dd>
1159 ssh with possible man-in-the-middle attack enabled
1160 (for an explanation see insecscp above).
1161 <p></p>
1162 </dd>
1163 <dt><b>help-zshglob</b> (<i>H-Glob()</i>)</dt><dd>
1164 Runs the function H-Glob() to expand or explain wildcards.
1165 <p></p>
1166 </dd>
1167 <dt><b>j</b> (<i>jobs -l</i>)</dt><dd>
1168 Prints status of jobs in the current shell session in long format.
1169 <p></p>
1170 </dd>
1171 <dt><b>l</b> (<i>ls -l --color=auto</i>)</dt><dd>
1172 Lists files in long output format with indicator for filetype appended
1173 to filename. If the terminal supports it, with colored output.
1174 <p></p>
1175 </dd>
1176 <dt><b>la</b> (<i>ls -la --color=auto</i>)</dt><dd>
1177 Lists files in long colored output format. Including file names
1178 starting with ".".
1179 <p></p>
1180 </dd>
1181 <dt><b>lad</b> (<i>ls -d .*(/)</i>)</dt><dd>
1182 Lists the dot directories (not their contents) in current directory.
1183 <p></p>
1184 </dd>
1185 <dt><b>lh</b> (<i>ls -hAl --color=auto</i>)</dt><dd>
1186 Lists files in long and human readable output format in nice colors,
1187 if available. Includes file names starting with "." except "." and
1188 "..".
1189 <p></p>
1190 </dd>
1191 <dt><b>ll</b> (<i>ls -l --color=auto</i>)</dt><dd>
1192 Lists files in long colored output format.
1193 <p></p>
1194 </dd>
1195 <dt><b>llog</b> (<i>$PAGER /var/log/syslog</i>)</dt><dd>
1196 Opens syslog in pager.
1197 <p></p>
1198 </dd>
1199 <dt><b>ls</b> (<i>ls -C --color=auto</i>)</dt><dd>
1200 Lists directory, entries are listed by columns and an indicator for
1201 file type is appended to each file name. Additionally the output is
1202 colored, if the terminal supports it.
1203 <p></p>
1204 </dd>
1205 <dt><b>lsa</b> (<i>ls -a .*(.)</i>)</dt><dd>
1206 Lists dot files in current working directory.
1207 <p></p>
1208 </dd>
1209 <dt><b>lsbig</b> (<i>ls -flh *(.OL[1,10])</i>)</dt><dd>
1210 Displays the ten biggest files (long and human readable output format).
1211 <p></p>
1212 </dd>
1213 <dt><b>lsd</b> (<i>ls -d *(/)</i>)</dt><dd>
1214 Shows directories.
1215 <p></p>
1216 </dd>
1217 <dt><b>lse</b> (<i>ls -d *(/^F)</i>)</dt><dd>
1218 Shows empty directories.
1219 <p></p>
1220 </dd>
1221 <dt><b>lsl</b> (<i>ls -l *(@)</i>)</dt><dd>
1222 Lists symbolic links in current directory.
1223 <p></p>
1224 </dd>
1225 <dt><b>lsnew</b> (<i>ls -rl *(D.om[1,10])</i>)</dt><dd>
1226 Displays the ten newest files (long output format).
1227 <p></p>
1228 </dd>
1229 <dt><b>lsnewdir</b> (<i>ls -rthdl *(/om[1,10]) .*(D/om[1,10])</i>)</dt><dd>
1230 Displays the ten newest directories and ten newest .directories.
1231 <p></p>
1232 </dd>
1233 <dt><b>lsold</b> (<i>ls -rtlh *(D.om[1,10])</i>)</dt><dd>
1234 Displays the ten oldest files (long output format).
1235 <p></p>
1236 </dd>
1237 <dt><b>lsolddir</b> (<i>ls -rthdl *(/Om[1,10]) .*(D/Om[1,10])</i>)</dt><dd>
1238 Displays the ten oldest directories and ten oldest .directories.
1239 <p></p>
1240 </dd>
1241 <dt><b>lss</b> (<i>ls -l *(s,S,t)</i>)</dt><dd>
1242 Lists files in current directory that have the setuid, setgid or sticky bit
1243 set.
1244 <p></p>
1245 </dd>
1246 <dt><b>lssmall</b> (<i>ls -Srl *(.oL[1,10])</i>)</dt><dd>
1247 Displays the ten smallest files (long output format).
1248 <p></p>
1249 </dd>
1250 <dt><b>lsw</b> (<i>ls -ld *(R,W,X.^ND/)</i>)</dt><dd>
1251 Displays all files which are world readable and/or world writable and/or
1252 world executable (long output format).
1253 <p></p>
1254 </dd>
1255 <dt><b>lsx</b> (<i>ls -l *(*)</i>)</dt><dd>
1256 Lists only executable files.
1257 <p></p>
1258 </dd>
1259 <dt><b>mdstat</b> (<i>cat /proc/mdstat</i>)</dt><dd>
1260 Lists all active md (i.e. linux software raid) devices with some information
1261 about them.
1262 <p></p>
1263 </dd>
1264 <dt><b>mq</b> (<i>hg -R $(readlink -f $(hg root)/.hg/patches)</i>)</dt><dd>
1265 Executes the commands on the versioned patch queue from current repository.
1266 <p></p>
1267 </dd>
1268 <dt><b>rmcdir</b> (<i>'cd ..; rmdir $OLDPWD || cd $OLDPWD</i>)</dt><dd>
1269 rmdir current working directory
1270 <p></p>
1271 </dd>
1272 <dt><b>screen</b> (<i>screen -c file</i>)</dt><dd>
1273 If invoking user is root, starts screen session with /etc/grml/screenrc
1274 as config file. If invoked by a regular user and users .screenc does not exist,
1275 starts screen with /etc/grml/screenrc_grml config if it exists, else fallbacks
1276 to /etc/grml/screenrc.
1277 <p></p>
1278 </dd>
1279 <dt><b>su</b> (<i>sudo su</i>)</dt><dd>
1280 If user is running a Grml live system, don't ask for any password, if she
1281 wants a root shell.
1282 <p></p>
1283 </dd>
1284 <dt><b>term2iso</b> (<i>echo 'Setting terminal to iso mode' ; print -n '\e%@'</i>)</dt><dd>
1285 Sets mode from UTF-8 to ISO 2022 (See:
1286 <a href="http://www.cl.cam.ac.uk/~mgk25/unicode.html#term">http://www.cl.cam.ac.uk/~mgk25/unicode.html#term</a>).
1287 <p></p>
1288 </dd>
1289 <dt><b>term2utf</b> (<i>echo 'Setting terminal to utf-8 mode'; print -n '\e%G'</i>)</dt><dd>
1290 Sets mode from ISO 2022 to UTF-8 (See:
1291 <a href="http://www.cl.cam.ac.uk/~mgk25/unicode.html#term">http://www.cl.cam.ac.uk/~mgk25/unicode.html#term</a>).
1292 <p></p>
1293 </dd>
1294 <dt><b>tlog</b> (<i>tail -f /var/log/syslog</i>)</dt><dd>
1295 Prints syslog continuously (See tail(1)).
1296 <p></p>
1297 </dd>
1298 <dt><b>up</b> (<i>aptitude update ; aptitude safe-upgrade</i>)</dt><dd>
1299 Performs a system update followed by a system upgrade using aptitude; run
1300 by sudo, if necessary. See au and ag above.
1301 <p></p>
1302 </dd>
1303 <dt><b>url-quote</b> (<i>autoload -U url-quote-magic ; zle -N self-insert url-quote-magic</i>)</dt><dd>
1304 After calling, characters of URLs as typed get automatically escaped, if necessary, to
1305 protect them from the shell.
1306 <p></p>
1307 </dd>
1308 <dt><b>$(uname -r)-reboot</b> (<i>kexec -l --initrd=/boot/initrd.img-"$(uname -r)" --command-line=\"$(cat /proc/cmdline)\" /boot/vmlinuz-"$(uname -r)"</i>)</dt><dd>
1309 Reboots using kexec(8) and thus reduces boot time by skipping hardware initialization of BIOS/firmware.
1310 <p></p>
1311 </dd>
1312 <dt><b>...</b> (<i>cd ../../</i>)</dt><dd>
1313 Changes current directory two levels higher.
1314 </dd>
1315 </dl>
1316 <h1>AUXILIARY FILES</h1>
1317 <p>
1318 This is a set of files, that - if they exist - can be used to customize the
1319 behaviour of <i>grmlzshrc</i>.
1320 </p>
1321 <dl>
1322 <dt><b>.zshrc.pre</b></dt><dd>
1323 Sourced at the very beginning of <i>grmlzshrc</i>. Among other things, it can
1324 be used to permantenly change <i>grmlzshrc</i>'s STARTUP VARIABLES (see above):
1325
1326 <pre>
1327 # show battery status in RPROMPT
1328 GRML_DISPLAY_BATTERY=1
1329 # always load the complete setup, even for root
1330 GRML_ALWAYS_LOAD_ALL=1
1331 </pre>
1332 <p></p>
1333 </dd>
1334 <dt><b>.zshrc.local</b></dt><dd>
1335 Sourced right before loading <i>grmlzshrc</i> is finished. There is a global
1336 version of this file (/etc/zsh/zshrc.local) which is sourced before the
1337 user-specific one.
1338 <p></p>
1339 </dd>
1340 <dt><b>.zdirs</b></dt><dd>
1341 Directory listing for persistent dirstack (see above).
1342 <p></p>
1343 </dd>
1344 <dt><b>.important_commands</b></dt><dd>
1345 List of commands, used by persistent history (see above).
1346 </dd>
1347 </dl>
1348 <h1>INSTALLATION ON NON-DEBIAN SYSTEMS</h1>
1349 <p>
1350 On Debian systems (<a href="http://www.debian.org">http://www.debian.org</a>) - and possibly Ubuntu
1351 (<a href="http://www.ubuntu.com">http://www.ubuntu.com</a>) and similar systems - it is very easy to get
1352 <i>grmlzshrc</i> via grml's .deb repositories.
1353 </p>
1354 <p>
1355 On non-debian systems, that is not an option, but all is not lost:
1356
1357 </p>
1358 <pre>
1359 % wget -O .zshrc http://git.grml.org/f/grml-etc-core/etc/zsh/zshrc
1360 </pre>
1361 <p>
1362 If you would also like to get separate function files (which you can put into
1363 your <b>$fpath</b>), you can browse and download them at:
1364 </p>
1365 <p>
1366 <a href="http://git.grml.org/?p=grml-etc-core.git;a=tree;f=usr_share_grml/zsh;hb=HEAD">http://git.grml.org/?p=grml-etc-core.git;a=tree;f=usr_share_grml/zsh;hb=HEAD</a>
1367 </p>
1368 <h1>ZSH REFCARD TAGS</h1>
1369 <p>
1370 If you read <i>grmlzshrc</i>'s code you may notice strange looking comments in
1371 it. These are there for a purpose. grml's zsh-refcard is automatically
1372 generated from the contents of the actual configuration file. However, we need
1373 a little extra information on which comments and what lines of code to take
1374 into account (and for what purpose).
1375 </p>
1376 <p>
1377 Here is what they mean:
1378 </p>
1379 <p>
1380 List of tags (comment types) used:
1381 </p>
1382 <dl>
1383 <dt><b>#a#</b></dt><dd>
1384 Next line contains an important alias, that should be included in the
1385 grml-zsh-refcard. (placement tag: @@INSERT-aliases@@)
1386 <p></p>
1387 </dd>
1388 <dt><b>#f#</b></dt><dd>
1389 Next line contains the beginning of an important function. (placement
1390 tag: @@INSERT-functions@@)
1391 <p></p>
1392 </dd>
1393 <dt><b>#v#</b></dt><dd>
1394 Next line contains an important variable. (placement tag:
1395 @@INSERT-variables@@)
1396 <p></p>
1397 </dd>
1398 <dt><b>#k#</b></dt><dd>
1399 Next line contains an important keybinding. (placement tag:
1400 @@INSERT-keybindings@@)
1401 <p></p>
1402 </dd>
1403 <dt><b>#d#</b></dt><dd>
1404 Hashed directories list generation: <i>start</i>: denotes the start of a list of
1405 'hash -d' definitions. <i>end</i>: denotes its end. (placement tag:
1406 @@INSERT-hasheddirs@@)
1407 <p></p>
1408 </dd>
1409 <dt><b>#A#</b></dt><dd>
1410 Abbreviation expansion list generation: <i>start</i>: denotes the beginning of
1411 abbreviations. <i>end</i>: denotes their end.
1412
1413 Lines within this section that end in '#d .*' provide extra documentation to
1414 be included in the refcard. (placement tag: @@INSERT-abbrev@@)
1415 <p></p>
1416 </dd>
1417 <dt><b>#m#</b></dt><dd>
1418 This tag allows you to manually generate refcard entries for code lines that
1419 are hard/impossible to parse.
1420 Example:
1421
1422 <pre>
1423 #m# k ESC-h Call the run-help function
1424 </pre>
1425
1426 That would add a refcard entry in the keybindings table for 'ESC-h' with the
1427 given comment.
1428
1429 So the syntax is: #m# &lt;section&gt; &lt;argument&gt; &lt;comment&gt;
1430 <p></p>
1431 </dd>
1432 <dt><b>#o#</b></dt><dd>
1433 This tag lets you insert entries to the 'other' hash. Generally, this should
1434 not be used. It is there for things that cannot be done easily in another way.
1435 (placement tag: @@INSERT-other-foobar@@)
1436 </dd>
1437 </dl>
1438 <p>
1439 All of these tags (except for m and o) take two arguments, the first
1440 within the tag, the other after the tag:
1441 </p>
1442 <p>
1443 #&lt;tag&gt;&lt;section&gt;# &lt;comment&gt;
1444 </p>
1445 <p>
1446 Where &lt;section&gt; is really just a number, which are defined by the @secmap
1447 array on top of 'genrefcard.pl'. The reason for numbers instead of names is,
1448 that for the reader, the tag should not differ much from a regular comment.
1449 For zsh, it is a regular comment indeed. The numbers have got the following
1450 meanings:
1451 </p>
1452 <dl>
1453 <dt><b>0</b></dt><dd>
1454 <i>default</i>
1455 <p></p>
1456 </dd>
1457 <dt><b>1</b></dt><dd>
1458 <i>system</i>
1459 <p></p>
1460 </dd>
1461 <dt><b>2</b></dt><dd>
1462 <i>user</i>
1463 <p></p>
1464 </dd>
1465 <dt><b>3</b></dt><dd>
1466 <i>debian</i>
1467 <p></p>
1468 </dd>
1469 <dt><b>4</b></dt><dd>
1470 <i>search</i>
1471 <p></p>
1472 </dd>
1473 <dt><b>5</b></dt><dd>
1474 <i>shortcuts</i>
1475 <p></p>
1476 </dd>
1477 <dt><b>6</b></dt><dd>
1478 <i>services</i>
1479 </dd>
1480 </dl>
1481 <p>
1482 So, the following will add an entry to the 'functions' table in the 'system'
1483 section, with a (hopefully) descriptive comment:
1484
1485 </p>
1486 <pre>
1487 #f1# Edit an alias via zle
1488 edalias() {
1489 </pre>
1490 <p>
1491
1492 It will then show up in the @@INSERT-aliases-system@@ replacement tag that can
1493 be found in 'grml-zsh-refcard.tex.in'. If the section number is omitted, the
1494 'default' section is assumed. Furthermore, in 'grml-zsh-refcard.tex.in'
1495 @@INSERT-aliases@@ is exactly the same as @@INSERT-aliases-default@@. If you
1496 want a list of <b>all</b> aliases, for example, use @@INSERT-aliases-all@@.
1497 </p>
1498 <h1>CONTRIBUTING</h1>
1499 <p>
1500 If you want to help to improve grml's zsh setup, clone the grml-etc-core
1501 repository from git.grml.org:
1502
1503 </p>
1504 <pre>
1505 % git clone git://git.grml.org/grml-etc-core.git
1506 </pre>
1507 <p>
1508 Make your changes, commit them; use '<b>git format-patch</b>' to create a series
1509 of patches and send those to the following address via '<b>git send-email</b>':
1510
1511 </p>
1512 <pre>
1513 grml-etc-core@grml.org
1514 </pre>
1515 <p>
1516 Doing so makes sure the right people get your patches for review and
1517 possibly inclusion.
1518 </p>
1519 <h1>STATUS</h1>
1520 <p>
1521 This manual page is the <b>reference</b> manual for <i>grmlzshrc</i>.
1522 </p>
1523 <p>
1524 That means that in contrast to the existing refcard it should document <b>every</b>
1525 aspect of the setup.
1526 </p>
1527 <p>
1528 This manual is currently not complete. If you want to help improving it, visit
1529 the following pages:
1530 </p>
1531 <p>
1532 <a href="http://wiki.grml.org/doku.php?id=zshrcmanual">http://wiki.grml.org/doku.php?id=zshrcmanual</a>
1533 </p>
1534 <p>
1535 <a href="http://lists.mur.at/pipermail/grml/2009-August/004609.html">http://lists.mur.at/pipermail/grml/2009-August/004609.html</a>
1536 </p>
1537 <p>
1538 Contributions are highly welcome.
1539 </p>
1540 <h1>AUTHORS</h1>
1541 <p>
1542 This manpage was written by Frank Terbeck &lt;<a href="mailto:ft@grml.org">ft@grml.org</a>&gt;, Joerg Woelke
1543 &lt;<a href="mailto:joewoe@fsmail.de">joewoe@fsmail.de</a>&gt;, Maurice McCarthy &lt;<a href="mailto:manselton@googlemail.com">manselton@googlemail.com</a>&gt; and Axel
1544 Beckert &lt;<a href="mailto:abe@deuxchevaux.org">abe@deuxchevaux.org</a>&gt;.
1545 </p>
1546 <h1>COPYRIGHT</h1>
1547 <p>
1548 Copyright (c) 2009-2013 Grml project &lt;<a href="http://grml.org">http://grml.org</a>&gt;
1549 </p>
1550 <p>
1551 This manpage is distributed under the terms of the GPL version 2.
1552 </p>
1553 <p>
1554 Most parts of grml's zshrc are distributed under the terms of GPL v2, too,
1555 except for <b>accept-line()</b> which are distributed under the same conditions
1556 as zsh itself (which is BSD-like).
1557 </p>
1558 </div>
1559 <!-- xhtml code generated by txt2tags 2.6 (http://txt2tags.org) -->
1560 <!-- cmdline: txt2tags -\-target xhtml -\-css-sugar -\-style t2t-modern.css -o- grmlzshrc.t2t -->
1561 </body></html>