zsh和oh my zsh 配置

zsh 设置

ohmyzsh安装

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

git extras[https://github.com/tj/git-extras]安装

$ git clone https://github.com/tj/git-extras.git
$ cd git-extras
# checkout the latest tag
$ git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
$ [sudo] make install

bash complete

when building android source, need to source >build/envsetup.sh
will complain "complete not found"

because android build use bash as default,complete is bash embed function

add below to .zshrc
bash
autoload -U compinit && compinit
autoload -U bashcompinit && bashcompinit

if build android source still error, and using bash is ok,
try to use

emulate bash

before make.

just ensure you have "#!/usr/bin/env bash" at the first line of your script

emulate sh -c '. ./myscript.sh'

git 命令卡死,cpu 占用率到100%

http://superuser.com/questions/458906/zsh-tab-completion-of-git-commands-is-very-slow-how-can-i-turn-it-off
添加到.zshrc
bash
__git_files () {
_wanted files expl 'local files' _files
}

autojump

autojump is a faster way to navigate your filesystem. It works by maintaining a database of the directories you use the most from the command line.

Directories must be visited first before they can be jumped to.

https://github.com/wting/autojump
bash
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py or ./uninstall.py

add the following line(s) to ~/.zshrc:

[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && source ~/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u