hg-prompt/quickstart/index.html @ 89c05d9e3225
hg-prompt: Update documentation.
author |
Steve Losh <steve@stevelosh.com> |
date |
Tue, 24 Nov 2009 20:21:06 -0500 |
parents |
fd8097ccb5c1 |
children |
8698c58f4ce2 |
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>
hg-prompt ยป Quick Start
</title>
<link rel="stylesheet" type="text/css" href="/media/css/reset.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/media/css/layout.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/media/css/typography.css" media="screen, projection" />
<link rel="stylesheet" type="text/css" href="/media/css/pygments.css" media="screen, projection" />
</head>
<body>
<div id="breadcrumbs">
<p>
<a href="/">index</a> »
quickstart
</p>
</div> <!-- div#breadcrumbs -->
<div id="content">
<h1 id="quick-start">Quick Start</h1>
<p>This guide will get you up and running so you can put some useful information into your shell prompt.</p>
<p>If you haven't already <a href="/hg-prompt/installation/">installed</a> it, do that now.</p>
<h2 id="a-simple-but-useful-prompt">A Simple (But Useful) Prompt</h2>
<p>Edit your <code>~/.bashrc</code> file to include something like this:</p>
<div class="codehilite"><pre>hg_ps1<span class="o">()</span> <span class="o">{</span>
hg prompt <span class="s2">"{ on {branch}}{ at {bookmark}}{status}"</span> 2> /dev/null
<span class="o">}</span>
<span class="nb">export </span><span class="nv">PS1</span><span class="o">=</span><span class="s1">'\u at \h in \w$(hg_ps1)\n$ '</span>
</pre></div>
<p><code>source ~/.bashrc</code> after to test it out. Make sure you're in a Mercurial repository or you won't see anything. This little prompt will give you something like this:</p>
<div class="codehilite"><pre><span class="go">steve at myhost in ~/src/hg-prompt on default at feature-bookmark?</span>
<span class="gp">$</span>
</pre></div>
<h2 id="an-advanced-prompt">An Advanced Prompt</h2>
<p>How about something a little more interesting?</p>
<div class="codehilite"><pre>hg_ps1<span class="o">()</span> <span class="o">{</span>
hg prompt <span class="s2">"{[+{incoming|count}]-->}{root|basename}{/{branch}}{-->[+{outgoing|count}]}{ at {bookmark}}{status}"</span> 2> /dev/null
<span class="o">}</span>
<span class="nb">export </span><span class="nv">PS1</span><span class="o">=</span><span class="s1">'$(hg_ps1)\n\u at \h in \w\n$ '</span>
</pre></div>
<p>And the result (this example assumes one incoming changeset and two outgoing):</p>
<div class="codehilite"><pre><span class="go">[+1]-->hg-prompt/default-->[+2] at feature-bookmark</span>
<span class="go">steve at myhost in ~/src/hg-prompt</span>
<span class="gp">$</span>
</pre></div>
<h2 id="learn-more">Learn More</h2>
<p>From here you can take a look at the <a href="/hg-prompt/documentation/">full documentation</a> to see all the interesting things <code>hg-prompt</code> can do.</p>
</div> <!-- div#content -->
<div id="footer">
<p>
hg-prompt —
Powered by <a href="http://bitbucket.org/zacharyvoase/markdoc">Markdoc</a>.
</p>
</div>
</body>
</html>