Lines 2-20
Link Here
|
2 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
2 |
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> |
3 |
<!-- $Header$ --> |
3 |
<!-- $Header$ --> |
4 |
|
4 |
|
5 |
<guide link="/doc/en/guide.xml" lang="en"> |
5 |
<guide link="/doc/en/zsh.xml" lang="en"> |
6 |
|
6 |
|
7 |
<title>Quick guide to Zsh installation and configuration</title> |
7 |
<title>zsh Configuration and Installation Guide</title> |
8 |
|
8 |
|
9 |
<author title="Author"> |
9 |
<author title="Author"> |
10 |
<mail link="hak8@wp.pl">Henryk Konsek</mail> |
10 |
<mail link="hak8@wp.pl">Henryk Konsek</mail> |
|
|
11 |
</author> |
12 |
<author title="Editor"> |
13 |
<mail link="chriswhite@gentoo.org">Chris White</mail> |
11 |
</author> |
14 |
</author> |
12 |
|
|
|
13 |
|
15 |
|
14 |
<abstract> |
16 |
<abstract> |
15 |
This guide shows how to install and configure Zsh quickly. After lecture of this document you |
17 |
This guide shows how to install and configure zsh quickly. After |
16 |
will be able use such Zsh features as advanced tab-completion, commands correction or prompt |
18 |
completing this document you will be able use such zsh features |
17 |
management. |
19 |
as advanced tab-completion, command correction and prompt management. |
18 |
</abstract> |
20 |
</abstract> |
19 |
|
21 |
|
20 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
22 |
<!-- The content of this document is licensed under the CC-BY-SA license --> |
Lines 27-57
Link Here
|
27 |
<chapter> |
29 |
<chapter> |
28 |
<title>Installation</title> |
30 |
<title>Installation</title> |
29 |
<section> |
31 |
<section> |
30 |
<title>Packages download</title> |
32 |
<title>Aquiring zsh</title> |
31 |
|
33 |
|
32 |
<body> |
34 |
<body> |
33 |
<p> |
35 |
<p> |
34 |
To install Zsh under Gentoo we need to emerge app-shells/zsh (Zsh itself) and app-shells/zsh-completion |
36 |
To install <c>zsh</c> under Gentoo we need to emerge <c>app-shells/zsh</c> |
35 |
(Zsh completion scripts) packages. |
37 |
(<c>zsh</c> itself) and <c>app-shells/zsh-completion</c> (<c>zsh</c> |
|
|
38 |
completion scripts) packages. |
36 |
</p> |
39 |
</p> |
37 |
|
40 |
|
38 |
<pre caption="Emerging Zsh"> |
41 |
<pre caption="Emerging zsh"> |
39 |
|
42 |
# <i>emerge zsh zsh-completion</i> |
40 |
# emerge zsh zsh-completion |
|
|
41 |
</pre> |
43 |
</pre> |
42 |
|
44 |
|
43 |
</body> |
45 |
</body> |
44 |
</section> |
46 |
</section> |
45 |
</chapter> |
47 |
</chapter> |
46 |
|
|
|
47 |
<chapter> |
48 |
<chapter> |
48 |
<title>Configuration</title> |
49 |
<title>Configuration</title> |
49 |
<section> |
50 |
<section> |
50 |
<title>Introduction</title> |
51 |
<title>Introduction</title> |
51 |
<body> |
52 |
<body> |
52 |
<p> |
53 |
<p> |
53 |
After installation Zsh seems to be very simple and rather limited in the area of functionality. To change |
54 |
After the installation, <c>zsh</c> seems to be very simple and rather limited |
54 |
this state several configuration fixes should be performed. |
55 |
in the area of functionality. To change this, several configuration fixes need |
|
|
56 |
to be performed. |
55 |
</p> |
57 |
</p> |
56 |
</body> |
58 |
</body> |
57 |
</section> |
59 |
</section> |
Lines 60-134
Link Here
|
60 |
<body> |
62 |
<body> |
61 |
|
63 |
|
62 |
<p> |
64 |
<p> |
63 |
To enable famous Zsh tab-completion system we have to type the following commands: |
65 |
To enable the famous <c>zsh</c> tab-completion system, the following commands |
|
|
66 |
must be entered: |
64 |
</p> |
67 |
</p> |
65 |
|
68 |
|
66 |
<pre caption="Completion enabling"> |
69 |
<pre caption="Completion enabling"> |
67 |
|
70 |
% <i>autoload -U compinit</i> |
68 |
% autoload -U compinit |
71 |
% <i>compinit</i> |
69 |
% compinit |
|
|
70 |
</pre> |
72 |
</pre> |
71 |
|
73 |
|
72 |
</body> |
74 |
</body> |
73 |
</section> |
75 |
</section> |
74 |
|
|
|
75 |
<section> |
76 |
<section> |
76 |
<title>Command correction</title> |
77 |
<title>Command correction</title> |
77 |
<body> |
78 |
<body> |
78 |
<p> |
79 |
<p> |
79 |
This is also a good idea to enable correction of the commands written under shell. |
80 |
It is also a good idea to enable the correction of the commands written under shell. |
80 |
</p> |
81 |
</p> |
81 |
|
82 |
|
82 |
<pre caption="Correction enabling"> |
83 |
<pre caption="Correction enabling"> |
83 |
|
84 |
% <i>setopt correctall</i> |
84 |
% setopt correctall |
|
|
85 |
</pre> |
85 |
</pre> |
86 |
|
86 |
|
87 |
</body> |
87 |
</body> |
88 |
</section> |
88 |
</section> |
89 |
|
|
|
90 |
<section> |
89 |
<section> |
91 |
<title>Prompts</title> |
90 |
<title>Prompts</title> |
92 |
<body> |
91 |
<body> |
93 |
<p> |
92 |
<p> |
94 |
Our prompt may seem quite boring however we can fix it easily in several steps. |
93 |
The prompt may seem quite boring however, but we can fix it easily in several |
95 |
At first we need to initialize advanced prompt support: |
94 |
steps. First, we need to initialize advanced prompt support: |
96 |
</p> |
95 |
</p> |
97 |
|
96 |
|
98 |
<pre caption="Advanced prompts enabling"> |
97 |
<pre caption="Advanced prompts enabling"> |
99 |
|
98 |
% <i>autoload -U promptinit</i> |
100 |
% autoload -U promptinit |
99 |
% <i>promptinit</i> |
101 |
% promptinit |
|
|
102 |
</pre> |
100 |
</pre> |
103 |
|
101 |
|
104 |
<p> |
102 |
<p> |
105 |
Available prompts samples may be printed via prompt -p command. Now we can activate our |
103 |
Available prompts samples may be printed via the <c>prompt -p</c> command. Now |
106 |
favourite one (oliver for example): |
104 |
we can activate our favorite one (oliver for example): |
107 |
</p> |
105 |
</p> |
108 |
|
106 |
|
109 |
<pre caption="Prompt choice"> |
107 |
<pre caption="Prompt choice"> |
110 |
|
108 |
% <i>prompt oliver</i> |
111 |
% prompt oliver |
|
|
112 |
</pre> |
109 |
</pre> |
113 |
|
110 |
|
114 |
</body> |
111 |
</body> |
115 |
</section> |
112 |
</section> |
116 |
|
|
|
117 |
</chapter> |
113 |
</chapter> |
118 |
|
|
|
119 |
<chapter> |
114 |
<chapter> |
120 |
<title>Saving settings</title> |
115 |
<title>Saving settings</title> |
121 |
<section> |
116 |
<section> |
122 |
<title>How to save Zsh settings in zshrc script</title> |
117 |
<title>Saving zsh settings</title> |
123 |
<body> |
118 |
<body> |
124 |
<p> |
119 |
<p> |
125 |
This is good idea to enable these option as a Zsh defaults for our system. Possible |
120 |
It is a good idea to enable this option as a <c>zsh</c> defaults for the system. |
126 |
way to achieve this is to write our settings in the /etc/zsh/zshrc script using our |
121 |
One possible way to achieve this is to write our settings in the |
127 |
favourite text editor (nano or vim for example): |
122 |
<path>/etc/zsh/zshrc</path> script using our favorite text editor (nano or vim |
|
|
123 |
for example): |
128 |
</p> |
124 |
</p> |
129 |
|
125 |
|
130 |
<pre caption="vim /etc/zsh/zshrc"> |
126 |
<pre caption="/etc/zsh/zshrc"> |
131 |
|
|
|
132 |
#!/bin/zsh |
127 |
#!/bin/zsh |
133 |
|
128 |
|
134 |
# completion |
129 |
# completion |
Lines 142-160
Link Here
|
142 |
autoload -U promptinit |
137 |
autoload -U promptinit |
143 |
promptinit |
138 |
promptinit |
144 |
prompt oliver |
139 |
prompt oliver |
145 |
|
|
|
146 |
</pre> |
140 |
</pre> |
147 |
|
141 |
|
148 |
<p> |
142 |
<p> |
149 |
The last thing we need to do is to set zshrc script as executable: |
143 |
The last thing we need to do is set the <path>/etc/zsh/zshrc</path> script as |
|
|
144 |
executable: |
150 |
</p> |
145 |
</p> |
151 |
|
146 |
|
152 |
<pre caption="Making zshrc executable"> |
147 |
<pre caption="Making zshrc executable"> |
153 |
|
148 |
% <i>chmod a+x /etc/zsh/zshrc</i> |
154 |
% chmod a+x /etc/zsh/zshrc |
|
|
155 |
</pre> |
149 |
</pre> |
156 |
</body> |
150 |
</body> |
157 |
</section> |
151 |
</section> |
158 |
</chapter> |
152 |
</chapter> |
159 |
|
|
|
160 |
</guide> |
153 |
</guide> |