Lines 26-38
Link Here
|
26 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
26 |
<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> |
27 |
<license/> |
27 |
<license/> |
28 |
|
28 |
|
29 |
<version>1.3</version> |
29 |
<version>1.4</version> |
30 |
<date>2006-02-20</date> |
30 |
<date>2006-02-21</date> |
31 |
|
31 |
|
32 |
<chapter> |
32 |
<chapter> |
33 |
<title>Installation</title> |
33 |
<title>Installation</title> |
34 |
<section> |
34 |
<section> |
35 |
<title>Aquiring zsh</title> |
35 |
<title>Acquiring zsh</title> |
36 |
|
36 |
|
37 |
<body> |
37 |
<body> |
38 |
<p> |
38 |
<p> |
Lines 159-164
Link Here
|
159 |
</section> |
159 |
</section> |
160 |
|
160 |
|
161 |
<section> |
161 |
<section> |
|
|
162 |
<title>History</title> |
163 |
<body> |
164 |
Unfortunately default <c>zsh</c> configuration in Gentoo does not include commands |
165 |
history support. Due to the fact that working with a shell with history |
166 |
disabled is far more than frustrating, we should enter the following |
167 |
commands: |
168 |
|
169 |
<pre caption="Basic history configuration"> |
170 |
% <i>export HISTSIZE=2000</i> |
171 |
% <i>export HISTFILE="$HOME/.history"</i> |
172 |
|
173 |
<comment>(otherwise history won't be saved)</comment> |
174 |
% <i>export SAVEHIST=$HISTSIZE</i> |
175 |
</pre> |
176 |
|
177 |
It is very comfortable to search commands in history using up/down |
178 |
arrow keys, especially after typing few first letters of desired command |
179 |
under shell. For example: |
180 |
|
181 |
<pre caption="History searching based on the first letters of the commands"> |
182 |
<comment>(Do not press Enter after typing)</comment> |
183 |
% <i>vim /etc/</i> |
184 |
<comment>(Now press up arrow key)</comment> |
185 |
% <i>vim /etc/fstab</i> |
186 |
<comment>(Press up arrow key once again)</comment> |
187 |
% <i>vim /etc/X11/xorg.conf</i> |
188 |
</pre> |
189 |
|
190 |
<p> |
191 |
To enable the feature above enter the following commands: |
192 |
</p> |
193 |
|
194 |
<pre caption="Setting context searching"> |
195 |
% <i>bindkey `tput kcuu1` history-beginning-search-backward >/dev/null 2>&1</i> |
196 |
% <i>bindkey `tput kcud1` history-beginning-search-forward >/dev/null 2>&1 </i> |
197 |
</pre> |
198 |
|
199 |
<p> |
200 |
To prevent history from recording duplicated entries (such as <c>ls |
201 |
-l</c> entered many times during single shell session) set |
202 |
<c>hist_ignore_all_dups</c> option. |
203 |
</p> |
204 |
|
205 |
<pre caption="Setting ignoring of duplicates "> |
206 |
% <i>setopt hist_ignore_all_dups</i> |
207 |
</pre> |
208 |
|
209 |
<p> |
210 |
Is also a useful trick to prevent particular entries from being recorded |
211 |
into a history by preceding them with at least one space. |
212 |
</p> |
213 |
|
214 |
<pre caption="Preventing particular entry from being recorded"> |
215 |
% <i>setopt hist_ignore_space</i> |
216 |
|
217 |
<comment>(This command won't be recorded. Note an extra space before it.)</comment> |
218 |
% <i> cat /proc/i/do/not/want/to/remember</i> |
219 |
</pre> |
220 |
|
221 |
|
222 |
</body> |
223 |
</section> |
224 |
|
225 |
<section> |
162 |
<title>Miscellaneous settings</title> |
226 |
<title>Miscellaneous settings</title> |
163 |
<body> |
227 |
<body> |
164 |
|
228 |
|