Note: Due to technical difficulties, the Archives are currently not up to date.
GMANE provides an alternative service for most mailing lists. c.f. bug 424647
List Archive: gentoo-doc
Hi.
As far as I know there is not section in Gentoo documentation concerning Zsh
configuration. I've written sample article covering basic Zsh installation
and configuration issues. I would be grateful for any feedback concerning my
doc.
Greetings.
HK
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link title="new" rel="stylesheet" href="css/main.css" type="text/css">
<link REL="shortcut icon" HREF="favicon.ico" TYPE="image/x-icon">
<title>Gentoo Linux
Documentation
--
Quick quide to Zsh installation and configuration</title>
</head>
<body style="margin-left:0px;margin-top:0px;" bgcolor="#ffffff"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td valign="top" height="125" bgcolor="#45347b"><table cellspacing="0" cellpadding="0" border="0" width="193">
<tr><td class="logobg" valign="top" align="center" height="88"><a href="/"><img border="0" src="images/gtop-s.jpg" alt="Gentoo Logo"></a></td></tr>
<tr><td class="logobg" valign="top" align="center" height="36"><a href="/"><img border="0" src="images/gbot-s.gif" alt="Gentoo Logo Side"></a></td></tr>
</table></td></tr>
<tr><td valign="top" align="right" colspan="1" bgcolor="#ffffff"><table border="0" cellspacing="0" cellpadding="0" width="100%"><tr>
<td width="99%" class="content" valign="top" align="left">
<br><p class="dochead">Quick quide to Zsh installation and configuration</p>
<form name="contents" action="http://www.gentoo.org">
<b>Contents</b>:
<select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:Arial,Helvetica, sans-serif; font-size:10"><option value="#doc_chap1">1. Installation</option>
<option value="#doc_chap2">2. Configuration</option>
<option value="#doc_chap3">3. Saving settings</option></select>
</form>
<p class="chaphead"><span class="chapnum"><a name="doc_chap1">1. </a></span>Installation</p>
<p class="secthead"><a name="doc_chap1_sect1">Packages download </a></p>
<p>
To install zsh under Gentoo we need to emerge app-shells/zsh (zsh itself) and app-shells/zsh-completion
(zsh completion scripts) packages.
</p>
<a name="doc_chap1_pre1"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 1.1: Emerging Zsh</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
# emerge zsh zsh-completion
</pre></td></tr>
</table>
<p class="chaphead"><span class="chapnum"><a name="doc_chap2">2. </a></span>Configuration</p>
<p class="secthead"><a name="doc_chap2_sect1">Introduction </a></p>
<p>
After installation Zsh seems to be very simple and rather limited in the area of functionality. To change
this state several configuration fixes should be performed.
</p>
<p class="secthead"><a name="doc_chap2_sect2">Advanced Tab-completion </a></p>
<p>
To enable famous Zsh tab-completion system we have to type the following commands:
</p>
<a name="doc_chap2_pre1"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 2.1: Completion enabling</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
% autoload -U compinit
% compinit
</pre></td></tr>
</table>
<p class="secthead"><a name="doc_chap2_sect3">Command correction </a></p>
<p>
This is also a good idea to enable correction of the commands written under shell.
</p>
<a name="doc_chap2_pre2"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 2.2: Correction enabling</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
% setopt correctall
</pre></td></tr>
</table>
<p class="secthead"><a name="doc_chap2_sect4">Prompts </a></p>
<p>
Our prompt may seem quite boring however we can fix it easily in several steps.
At first we need to initalize advanced prompt support:
</p>
<a name="doc_chap2_pre3"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 2.3: Advanced prompts enabling</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
% autoload -U promptinit
% promptinit
</pre></td></tr>
</table>
<p>
Available prompts samples may be printed via prompt -p command. Now we can activate our
favourite one (oliver for example):
</p>
<a name="doc_chap2_pre4"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 2.4: Prompt choice</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
% prompt oliver
</pre></td></tr>
</table>
<p class="chaphead"><span class="chapnum"><a name="doc_chap3">3. </a></span>Saving settings</p>
<p class="secthead"><a name="doc_chap3_sect1">How to save zsh settings in zshrc script </a></p>
<p>
This is good idea to enable these option as a zsh defaults for our system. Possible
way to achieve this is to write our settings in the /etc/zsh/zshrc script using our
favourite text editor (nano or vim for example):
</p>
<a name="doc_chap3_pre1"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 3.1: vim /etc/zsh/zshrc</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
#!/bin/zsh
# completion
autoload -U compinit
compinit
# correction
setopt correctall
# prompt
autoload -U promptinit
promptinit
prompt oliver
</pre></td></tr>
</table>
<p>
The last thing we need to do is to set zshrc script as executable:
</p>
<a name="doc_chap3_pre2"></a><table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr><td class="infohead" bgcolor="#7a5ada"><p class="caption">
Code listing 3.2: Making zshrc executable</p></td></tr>
<tr><td bgcolor="#ddddff"><pre>
% chmod a+x /etc/zsh/zshrc
</pre></td></tr>
</table>
<br><tt>
The contents of this document are licensed under the <a href="http://creativecommons.org/licenses/by-sa/1.0">Creative Commons - Attribution / Share Alike</a> license.
</tt><br>
</td>
<td width="1%" bgcolor="#dddaec" valign="top"><table border="0" cellspacing="5" cellpadding="0">
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center" class="alttext">
Updated 2006-02-18</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td class="alttext">
<b><a class="altlink" href="mailto:hak8@...">Henryk Konsek</a></b>
<br><i>Author</i><br><br>
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td class="alttext">
<b>Summary:</b>
This guide shows how to install and configure Zsh quickly. After lecture of this document you
will be able use such Zsh features as advanced tab-completion, commands correction or prompt
management.
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center">
<p class="alttext"><b>Donate</b> to support our development efforts.
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick"><input type="hidden" name="business" value="drobbins@g.o"><input type="hidden" name="item_name" value="Gentoo Linux Support"><input type="hidden" name="item_number" value="1000"><input type="hidden" name="image_url" value="images/paypal.png"><input type="hidden" name="no_shipping" value="1"><input type="hidden" name="return" value="http://www.gentoo.org"><input type="hidden" name="cancel_return" value="http://www.gentoo.org"><input type="image" src="" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center"><a href="http://store.gentoo.org"><img src="images/store.png" alt="The Gentoo Linux Store" border="0"></a></td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center">
<a href="http://www.phparch.com/bannerclick.php?AID=68&BID=1&BT=127929" target="_top"><img src="images/phpa-gentoo.gif" width="125" height="144" alt="php|architect" border="0"></a><p class="alttext">
php|architect is the monthly magazine for PHP professionals, available
worldwide in print and electronic format. A percentage of all the sales
will be donated back into the Gentoo project.
</p>
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center">
<a href="http://www.tek.net" target="_top"><img src="images/tek-gentoo.gif" width="125" height="125" alt="Tek Alchemy" border="0"></a><p class="alttext">
Tek Alchemy offers dedicated servers and other hosting solutions running Gentoo Linux.
</p>
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center">
<a href="http://www.qksrv.net/click-477620-5032687" target="_top"><img src="http://www.qksrv.net/image-477620-5032687" width="125" height="125" alt="DDR Memory at Crucial.com" border="0"></a><p class="alttext">
Purchase RAM from <b>Crucial.com</b> and a percentage of your sale will go towards further Gentoo Linux development.
</p>
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
<tr><td align="center">
<a href="http://www.netraverse.com/gentoo.htm" target="_top"><img src="images/netraverse-gentoo.gif" width="125" height="102" alt="Win4Lin at NeTraverse" border="0"></a><p class="alttext">
Win4Lin from <b>NeTraverse</b> lets you run Windows applications under Gentoo Linux at native speeds.
</p>
</td></tr>
<tr><td><img src="images/line.gif" alt="line"></td></tr>
</table></td>
</tr></table></td></tr>
<tr><td colspan="2" align="right" class="infohead" width="100%" bgcolor="#7a5ada">
Copyright 2001-2003 Gentoo Technologies, Inc. Questions, Comments, Corrections? Email <a class="highlight" href="mailto:www@g.o">www@g.o</a>.
</td></tr>
</table></body>
</html>
|
|