blog/content/post/2009/03/22/2009-03-22-00001132.md

59 lines
5.2 KiB
Markdown

---
title: zshの設定
author: kazu634
date: 2009-03-22
wordtwit_post_info:
- 'O:8:"stdClass":13:{s:6:"manual";b:0;s:11:"tweet_times";i:1;s:5:"delay";i:0;s:7:"enabled";i:1;s:10:"separation";s:2:"60";s:7:"version";s:3:"3.7";s:14:"tweet_template";b:0;s:6:"status";i:2;s:6:"result";a:0:{}s:13:"tweet_counter";i:2;s:13:"tweet_log_ids";a:1:{i:0;i:4535;}s:9:"hash_tags";a:0:{}s:8:"accounts";a:1:{i:0;s:7:"kazu634";}}'
categories:
- zsh
---
<div class="section">
<p>
DebianをLennyに新規インストールしてみた。これまでの環境をまっさらに。.zshrcを保存していなかったので、かなり涙目に。。。これからはここからコピーするように、備忘録として投稿:
</p>
<pre class="syntax-highlight">
<span class="synComment"># === Completition ===</span>
<span class="synStatement">autoload</span> -U compinit
compinit
<span class="synStatement">setopt</span> correct
<span class="synComment"># === Prediction ===</span>
<span class="synStatement">autoload</span> predict-on
predict-on
<span class="synComment"># === History ===</span>
<span class="synSpecial">HISTFILE</span><span class="synStatement">=</span>~/.zhistory
<span class="synSpecial">SAVEHIST</span><span class="synStatement">=</span><span class="synConstant">10000</span>
<span class="synStatement">setopt</span> hist_no_store hist_ignore_dups hist_reduce_blanks hist_ignore_space
<span class="synStatement">setopt</span> sharehistory
<span class="synComment"># === Key Bind ===</span>
<span class="synStatement">bindkey</span> <span class="synStatement">-e</span>
<span class="synComment"># === Color ===</span>
<span class="synStatement">autoload</span> -U colors
colors
<span class="synComment"># === Prompt ===</span>
<span class="synSpecial">RPROMPT</span><span class="synStatement">=</span><span class="synConstant">&#34;%~ </span><span class="synStatement">[</span><span class="synConstant">%h</span><span class="synStatement">]</span><span class="synConstant">&#34;</span>
<span class="synComment"># http://blog.</span><span class="synConstant">8</span><span class="synComment">-p.info/</span><span class="synConstant">2009</span><span class="synComment">/</span><span class="synConstant">01</span><span class="synComment">/red-prompt</span>
<span class="synSpecial">PROMPT</span><span class="synStatement">=</span><span class="synConstant">&#34;%</span><span class="synStatement">{</span><span class="synSpecial">$fg</span><span class="synStatement">[</span><span class="synConstant">green</span><span class="synStatement">]</span><span class="synConstant">%</span><span class="synStatement">}</span><span class="synConstant">%n@%m%#%</span><span class="synStatement">{</span><span class="synSpecial">$reset_color</span><span class="synConstant">%</span><span class="synStatement">}</span><span class="synConstant"> &#34;</span>
precmd () <span class="synStatement">{</span>
<span class="synSpecial">PROMPT</span><span class="synStatement">=</span><span class="synConstant">&#34;%</span><span class="synStatement">{</span><span class="synConstant">%</span><span class="synStatement">(</span><span class="synConstant">?.</span><span class="synSpecial">$fg</span><span class="synStatement">[</span><span class="synConstant">green</span><span class="synStatement">]</span><span class="synConstant">.</span><span class="synSpecial">$fg</span><span class="synStatement">[</span><span class="synConstant">red</span><span class="synStatement">])</span><span class="synConstant">%</span><span class="synStatement">}</span><span class="synConstant">%n@%m%#%</span><span class="synStatement">{</span><span class="synSpecial">$reset_color</span><span class="synConstant">%</span><span class="synStatement">}</span><span class="synConstant"> &#34;</span>
<span class="synStatement">}</span>
<span class="synComment"># === Direcotry ===</span>
<span class="synStatement">setopt</span> auto_pushd
<span class="synComment"># === Aliases ===</span>
<span class="synStatement">alias</span> ls<span class="synStatement">=</span><span class="synConstant">&#34;ls --color=auto&#34;</span>
<span class="synStatement">alias</span> ll<span class="synStatement">=</span><span class="synConstant">&#34;ls -l --color=auto&#34;</span>
<span class="synStatement">alias</span> cp<span class="synStatement">=</span><span class="synConstant">&#34;cp -p&#34;</span>
<span class="synStatement">alias</span> ld<span class="synStatement">=</span><span class="synConstant">&#34;ls -l --color=auto </span><span class="synStatement">|</span><span class="synConstant"> grep ^d&#34;</span>
<span class="synStatement">alias</span> aptitude<span class="synStatement">=</span><span class="synConstant">&#34;sudo aptitude&#34;</span>
<span class="synComment"># === Misc ===</span>
<span class="synComment"># For Emacs Tramp Access</span>
<span class="synStatement">case</span> <span class="synConstant">&#34;</span><span class="synSpecial">$TERM</span><span class="synConstant">&#34;</span> <span class="synStatement">in</span>
dumb <span class="synStatement">|</span> emacs<span class="synStatement">)</span>
<span class="synSpecial">PROMPT</span><span class="synStatement">=</span><span class="synConstant">&#34;%m:%~&#62; &#34;</span>
<span class="synStatement">unsetopt</span> zle
<span class="synStatement">;;</span>
<span class="synStatement">esac</span>
</pre>
</div>