Merge remote-tracking branch 'origin/github/pr/45'
[grml.org.git] / docs / grml-doc-3.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2 <HTML>
3 <HEAD>
4  <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
5  <TITLE>grml - Linux for system administrators and texttool users: texttool-users tasks</TITLE>
6  <LINK HREF="grml-doc-4.html" REL=next>
7  <LINK HREF="grml-doc-2.html" REL=previous>
8  <LINK HREF="grml-doc.html#toc3" REL=contents>
9 </HEAD>
10 <BODY>
11 <A HREF="grml-doc-4.html">Next</A>
12 <A HREF="grml-doc-2.html">Previous</A>
13 <A HREF="grml-doc.html#toc3">Contents</A>
14 <HR>
15 <H2><A NAME="s3">3.</A> <A HREF="grml-doc.html#toc3">texttool-users tasks</A></H2>
16
17 <H2><A NAME="zsh"></A> <A NAME="ss3.1">3.1</A> <A HREF="grml-doc.html#toc3.1">exploring the zsh</A>
18 </H2>
19
20 <H3>introduction</H3>
21
22 <P>The default shell of grml is the zsh. You'll find a preconfigured zsh.
23 Main configuration of zsh is located in /etc/zsh/. This documentation
24 covers current version of zsh (>=4.2).</P>
25
26 <H3>completition system</H3>
27
28 <P>You'll get a zsh with the completition mechanism. grml system loads the
29 completion mechanism by default:</P>
30 <P>
31 <BLOCKQUOTE><CODE>
32 <HR>
33 <PRE>
34 autoload -U compinit &amp;&amp; compinit
35 zmodload -i zsh/complist
36 </PRE>
37 <HR>
38 </CODE></BLOCKQUOTE>
39 </P>
40 <P>Now it is possible to use the powerful completition mechanism of zsh.
41 For example file completition is something you might know from other shells:</P>
42 <P>
43 <BLOCKQUOTE><CODE>
44 <HR>
45 <PRE>
46 mika@grml /tmp/mplayer-1.0-pre4 % vim debian/cont&lt;press tab>
47 </PRE>
48 <HR>
49 </CODE></BLOCKQUOTE>
50 </P>
51 <P>But zsh can provide completition also by detecting the context:
52 <BLOCKQUOTE><CODE>
53 <HR>
54 <PRE>
55 mika@grml ~ % ssh grml@&lt;press tab>
56 completing host
57 grml       localhost
58 </PRE>
59 <HR>
60 </CODE></BLOCKQUOTE>
61 </P>
62 <P>And it's possible to extend and adjust the completition mechanism.
63 Take a look at the Makefile-completition:</P>
64 <P>
65 <BLOCKQUOTE><CODE>
66 <HR>
67 <PRE>
68 mika@grml /tmp/mplayer-1.0-pre4 % debian/rules &lt;press tab>
69 completing make target
70 binary           binary-indep     build-stamp      configure        install          patch-stamp
71 binary-arch      build            clean            configure-stamp  patch            unpatch
72 </PRE>
73 <HR>
74 </CODE></BLOCKQUOTE>
75 </P>
76 <P>The following listing is the output provided by running 'bindkey' on zsh
77 configuration on the grml system. Notice that the sequence '^[' in bindkey
78 commands refers to the escape key.  '^' refers to the control key.  '^A' is
79 the short form for ctrl-a. Take a closer look at it because using
80 keybindings for special task is a very important step to become a poweruser
81 on the command line.</P>
82 <P>
83 <BLOCKQUOTE><CODE>
84 <HR>
85 <PRE>
86 "^@" set-mark-command
87 "^A" beginning-of-line
88 "^B" backward-char
89 "^D" delete-char-or-list
90 "^E" end-of-line
91 "^F" forward-char
92 "^G" send-break
93 "^H" backward-delete-char
94 "^I" expand-or-complete
95 "^J" accept-line
96 "^K" kill-line
97 "^L" clear-screen
98 "^M" accept-line
99 "^N" down-line-or-history
100 "^O" accept-line-and-down-history
101 "^P" up-line-or-history
102 "^Q" push-line
103 "^R" history-incremental-search-backward
104 "^S" history-incremental-search-forward
105 "^T" transpose-chars
106 "^U" kill-whole-line
107 "^V" quoted-insert
108 "^W" backward-kill-word
109 "^X^B" vi-match-bracket
110 "^X^F" vi-find-next-char
111 "^X^J" vi-join
112 "^X^K" kill-buffer
113 "^X^N" infer-next-history
114 "^X^O" overwrite-mode
115 "^X^R" _read_comp
116 "^X^U" undo
117 "^X^V" vi-cmd-mode
118 "^X^X" exchange-point-and-mark
119 "^X^Z" predict-on
120 "^X*" expand-word
121 "^X=" what-cursor-position
122 "^X?" _complete_debug
123 "^XC" _correct_filename
124 "^XG" list-expand
125 "^XK" expand-kept-result
126 "^Xa" _expand_alias
127 "^Xc" _correct_word
128 "^Xd" _list_expansions
129 "^Xe" _expand_word
130 "^Xg" list-expand
131 "^Xh" _complete_help
132 "^Xk" insert-kept-result
133 "^Xm" _most_recent_file
134 "^Xn" _next_tags
135 "^Xr" history-incremental-search-backward
136 "^Xs" history-incremental-search-forward
137 "^Xt" _complete_tag
138 "^Xu" undo
139 "^X~" _bash_list-choices
140 "^Y" yank
141 "^Z" predict-off
142 "^[^D" list-choices
143 "^[^G" send-break
144 "^[^H" backward-kill-word
145 "^[^I" self-insert-unmeta
146 "^[^J" self-insert-unmeta
147 "^[^L" clear-screen
148 "^[^M" self-insert-unmeta
149 "^[^_" copy-prev-word
150 "^[ " expand-history
151 "^[!" expand-history
152 "^[\"" quote-region
153 "^[\$" spell-word
154 "^['" quote-line
155 "^[," _history-complete-newer
156 "^[-" neg-argument
157 "^[." insert-last-word
158 "^[/" _history-complete-older
159 "^[0" digit-argument
160 "^[1" digit-argument
161 "^[2" digit-argument
162 "^[3" digit-argument
163 "^[4" digit-argument
164 "^[5" digit-argument
165 "^[6" digit-argument
166 "^[7" digit-argument
167 "^[8" digit-argument
168 "^[9" digit-argument
169 "^[&lt;" beginning-of-buffer-or-history
170 "^[>" end-of-buffer-or-history
171 "^[?" which-command
172 "^[A" accept-and-hold
173 "^[B" backward-word
174 "^[C" capitalize-word
175 "^[D" kill-word
176 "^[F" forward-word
177 "^[G" get-line
178 "^[H" run-help
179 "^[L" down-case-word
180 "^[N" history-search-forward
181 "^[OA" up-line-or-history
182 "^[OB" down-line-or-history
183 "^[OC" forward-char
184 "^[OD" backward-char
185 "^[P" history-search-backward
186 "^[Q" push-line
187 "^[S" spell-word
188 "^[T" transpose-words
189 "^[U" up-case-word
190 "^[W" copy-region-as-kill
191 "^[[1~" beginning-of-line
192 "^[[3~" delete-char
193 "^[[4~" end-of-line
194 "^[[A" up-line-or-search
195 "^[[B" down-line-or-search
196 "^[[C" forward-char
197 "^[[D" backward-char
198 "^[_" insert-last-word
199 "^[a" accept-and-hold
200 "^[b" backward-word
201 "^[c" capitalize-word
202 "^[d" kill-word
203 "^[e" edit-command-line
204 "^[f" forward-word
205 "^[g" get-line
206 "^[h" run-help
207 "^[l" down-case-word
208 "^[n" history-search-forward
209 "^[p" history-search-backward
210 "^[q" push-line
211 "^[s" spell-word
212 "^[t" transpose-words
213 "^[u" up-case-word
214 "^[w" copy-region-as-kill
215 "^[x" execute-named-cmd
216 "^[y" yank-pop
217 "^[z" execute-last-named-cmd
218 "^[|" vi-goto-column
219 "^[~" _bash_complete-word
220 "^[^?" backward-kill-word
221 "^_" undo
222 " "-"~" self-insert
223 "^?" backward-delete-char
224 "\M-^@"-"\M-^?" self-insert
225 </PRE>
226 <HR>
227 </CODE></BLOCKQUOTE>
228 </P>
229 <P>zsh supports many options (see 'man 1 zshoptions' for more details).
230 To get the current settings run the command 'setopt' without any options.
231 On the grml system you'll find the following options set:</P>
232 <P>
233 <DL>
234
235 <DT><B>append_history</B><DD><P>If this is set, zsh sessions will append their history
236 list to the history file, rather than overwrite it. Thus, multiple parallel
237 zsh sessions will all have their history lists added to the history file,
238 in the order they are killed.</P>
239
240 <DT><B>autocd</B><DD><P>If a command is issued that can't be executed as a normal
241 command, and the command is the name of a directory, perform the cd command
242 to that directory.</P>
243
244 <DT><B>noclobber</B><DD><P>Does not allow `>' redirection to truncate existing files,
245 and `>>' to create files. You must use `>!' or `>|' to truncate a file, and
246 `>>!' or `>>|' to create a file. This options is prevents files from being
247 deleted by accident.</P>
248
249 <DT><B>correct</B><DD><P>Try to correct the spelling of commands. Note that, when the
250 HASH_LIST_ALL option is not set or when some directories in the path are
251 not readable, this may falsely report spelling errors the first time some
252 commands are used.</P>
253
254 <DT><B>extendedglob</B><DD><P>Treat the `#', `&nbsp;' and `^' characters as part of
255 patterns for filename generation, etc. (An initial unquoted `&nbsp;' always
256 produces named directory expansion.)</P>
257
258 <DT><B>extendedhistory</B><DD><P>Save each command's beginning timestamp (in seconds
259 since the epoch) and the duration (in seconds) to the history file.</P>
260
261 <DT><B>hash_list_all</B><DD><P>Whenever a command completion is attempted, make sure
262 the entire command path is hashed first. This makes the first completion
263 slower.</P>
264
265 <DT><B>histallowclobber</B><DD><P>Add `|' to output redirections in the history. This
266 allows history references to clobber files even when CLOBBER is unset.</P>
267
268 <DT><B>histignorealldups</B><DD><P>If a new command line being added to the history
269 list duplicates an older one, the older command is removed from the list
270 (even if it is not the previous event).</P>
271
272 <DT><B>histignorespace</B><DD><P>Remove command lines from the history list when the
273 first character on the line is a space, or when one of the expanded aliases
274 contains a leading space. Note that the command lingers in the internal
275 history until the next command is entered before it vanishes, allowing you
276 to briefly reuse or edit the line. If you want to make it vanish right away
277 without entering another command, type a space and press return.</P>
278
279 <DT><B>interactive</B><DD><P>This is an interactive shell. This option is set upon
280 initialisation if the standard input is a tty and commands are being read
281 from standard input. (See the discussion of SHIN_STDIN.) This heuristic may
282 be overridden by specifying a state for this option on the command line.
283 The value of this option cannot be changed anywhere other than the command
284 line.</P>
285
286 <DT><B>monitor</B><DD><P>Allow job control. Set by default in interactive shells.</P>
287
288 <DT><B>notify</B><DD><P>Report the status of background jobs immediately, rather than
289 waiting until just before printing a prompt.</P>
290
291 <DT><B>promptsubst</B><DD><P>If set, parameter expansion, command substitution and
292 arithmetic expansion are performed in prompts. Substitutions within prompts
293 do not affect the command status.</P>
294
295 <DT><B>norcs</B><DD><P>After /etc/zshenv is sourced on startup, source the .zshenv,
296 /etc/zprofile, .zprofile, /etc/zshrc, .zshrc, /etc/zlogin, .zlogin, and
297 .zlogout files, as described in the section `Files'. If this option is
298 unset, the /etc/zshenv file is still sourced, but any of the others will
299 not be; it can be set at any time to prevent the remaining startup files
300 after the currently executing one from being sourced.</P>
301
302 <DT><B>sharehistory</B><DD><P>This option both imports new commands from the history
303 file, and also causes your typed commands to be appended to the history
304 file. If you find that you want more control over when commands get
305 imported, you may wish to turn SHARE_HISTORY off, INC_APPEND_HISTORY on,
306 and then manually import commands whenever you need them using `fc -RI'.</P>
307
308 <DT><B>shinstdin</B><DD><P>Commands are being read from the standard input. Commands
309 are read from standard input if no command is specified with -c and no file
310 of commands is specified. If SHIN_STDIN is set explicitly on the command
311 line, any argument that would otherwise have been taken as a file to run
312 will instead be treated as a normal positional parameter. Note that setting
313 or unsetting this option on the command line does not necessarily affect
314 the state the option will have while the shell is running - that is purely
315 an indicator of whether on not commands are actually being read from
316 standard input. The value of this option cannot be changed anywhere other
317 than the command line.</P>
318
319 <DT><B>zle</B><DD><P>Use the zsh line editor. Set by default in interactive shells
320 connected to a terminal.</P>
321
322 </DL>
323 </P>
324
325 <H2><A NAME="ss3.2">3.2</A> <A HREF="grml-doc.html#toc3.2">powerusing without X</A>
326 </H2>
327
328 <H3>zsh</H3>
329
330 <P>See section zsh for more details.</P>
331
332 <H3>screen</H3>
333
334 <P>...</P>
335
336 <H3>vim</H3>
337
338 <P>...</P>
339
340 <H3>mutt</H3>
341
342 <P>grml-mutt</P>
343
344 <H3>slrn</H3>
345
346 <P>grml-slrn</P>
347
348 <HR>
349 <A HREF="grml-doc-4.html">Next</A>
350 <A HREF="grml-doc-2.html">Previous</A>
351 <A HREF="grml-doc.html#toc3">Contents</A>
352 </BODY>
353 </HTML>