<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Supernova &#187; zsh</title>
	<atom:link href="http://blog.dealforest.net/category/zsh/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.dealforest.net</link>
	<description>be careful, be bravely</description>
	<lastBuildDate>Mon, 17 May 2010 04:44:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>&#8220;Git だろうと Mercurial だろうと、ブランチ名をzshのプロンプトにスマートに表示する方法&#8221;が便利すぎる件</title>
		<link>http://blog.dealforest.net/2009/08/repositorys-branch-preview-zsh-prompt/</link>
		<comments>http://blog.dealforest.net/2009/08/repositorys-branch-preview-zsh-prompt/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 18:19:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[zsh]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://blog.dealforest.net/?p=562</guid>
		<description><![CDATA[&#8220;Git だろうと Mercurial だろうと、ブランチ名をzshのプロンプトにスマートに表示する方法&#8221; で紹介されている zsh の vcs_info という関数を使って
git や mercurial のブランチ名をプロンプトに表示しているみたいです。

git 使ってたら実際どのブランチいじってるのかわからなくなることが
多々あって困ってたのでさっそく導入してみました。


git リポジトリ

svn リポジトリ

svn リポジトリ


はまったのは &#8220;vcs_info: function definition file not found&#8221; というエラーが
表示され vcs_info が使用できなかった。
これはバージョンを 4.3.6-dev-0+20080929-1 以降にすればいいらしい。


mac の ports の場合は zsh-devel でいれないと 4.3.6 以下なので使用できない。
zsh-devel をインストールして /opt/local/bin/zsh-4.3.10 から /bin/zsh へと
/etc/zprofile から /opt/local/etc/zprofile へシンボリックリンクを張って準備完了。


zprofile のシンボリックリンクを張らないと PATH の環境変数が足らなくなる。
/usr/bin とかその辺の PATH をここを呼んで足してるみたい。
.zshrc の設定に関しては本家の方で詳しくまとまってます。
.zshrc の一部抜粋でこんな感じです。


autoload -Uz vcs_info
zstyle ':vcs_info:*' formats ':(%s)%b'
zstyle [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://d.hatena.ne.jp/mollifier/20090814/p1">&#8220;Git だろうと Mercurial だろうと、ブランチ名をzshのプロンプトにスマートに表示する方法&#8221;</a> で紹介されている zsh の vcs_info という関数を使って<br />
git や mercurial のブランチ名をプロンプトに表示しているみたいです。</p>
<p>
git 使ってたら実際どのブランチいじってるのかわからなくなることが<br />
多々あって困ってたのでさっそく導入してみました。
</p>
<div style="margin:0px;padding:0px;">
<p align="center">git リポジトリ</p>
<p><img src="http://blog.dealforest.net/wp-content/uploads/2009/08/demo-git.png" width="100%" /></p>
<p align="center">svn リポジトリ</p>
<p><img src="http://blog.dealforest.net/wp-content/uploads/2009/08/demo-svn.png" width="100%" /></p>
<p align="center">svn リポジトリ</p>
<p><img src="http://blog.dealforest.net/wp-content/uploads/2009/08/demo-hg.png" width="100%" />
</div>
<p>はまったのは <strong>&#8220;vcs_info: function definition file not found&#8221;</strong> というエラーが<br />
表示され vcs_info が使用できなかった。<br />
これはバージョンを <strong>4.3.6-dev-0+20080929-1</strong> 以降にすればいいらしい。
</p>
<p>
mac の ports の場合は zsh-devel でいれないと 4.3.6 以下なので使用できない。<br />
zsh-devel をインストールして /opt/local/bin/zsh-4.3.10 から /bin/zsh へと<br />
/etc/zprofile から /opt/local/etc/zprofile へシンボリックリンクを張って準備完了。
</p>
<p>
zprofile のシンボリックリンクを張らないと PATH の環境変数が足らなくなる。<br />
/usr/bin とかその辺の PATH をここを呼んで足してるみたい。<br />
.zshrc の設定に関しては<a href="http://d.hatena.ne.jp/mollifier/20090814/p1">本家</a>の方で詳しくまとまってます。<br />
.zshrc の一部抜粋でこんな感じです。
</p>

<div class="wp_syntax"><div class="code"><pre class="shell" style="font-family:monospace;">autoload -Uz vcs_info
zstyle ':vcs_info:*' formats ':(%s)%b'
zstyle ':vcs_info:*' actionformats ':(%s)%b|%a'
precmd () {
    psvar=()
    LANG=en_US.UTF-8 vcs_info
    [[ -n &quot;$vcs_info_msg_0_&quot; ]] &amp;&amp; psvar[1]=&quot;$vcs_info_msg_0_&quot;
}
PROMPT=&quot;%{${fg[yellow]}%}[%n@%m%1(v|%F{green}%1v%f|)%{${fg[yellow]}%}]%{${reset_color}%}%b &quot;</pre></div></div>

<p>zsh ちゃんと勉強すればもっと便利になりそうだな</p>
<h3>参考資料</h3>
<p><a href="http://d.hatena.ne.jp/bannyan/20090820/1250777187">vcs_info: function definition file not found</a></p>
<p><p>アマゾンのサーバでエラーが起こっているかもしれません。一度ページを再読み込みしてみてください。</p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.dealforest.net/2009/08/repositorys-branch-preview-zsh-prompt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
