Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mba811/8c89a924272dddd6fae1 to your computer and use it in GitHub Desktop.
Save mba811/8c89a924272dddd6fae1 to your computer and use it in GitHub Desktop.
zsh与oh-my-zsh

##安装zsh

brew install zsh

设置zsh为默认shell

mate /etc/shells

在文末增加:

/usr/local/bin/zsh

将zsh设置为默认的Shell:

chsh -s /usr/local/bin/zsh

重新打动iterm2。

##配置zsh

目前流行的安装配置文件有2个.一个是官网的grml-zsh-config;另一个是oh-my-zsh.

Rails开发者一般推荐后者.安装方式如下:

cd ~/.  #进入根目录

#自动安装脚本

wget --no-check-certificate https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | sh

然后修改m.zshrc,将原来.bash_profile与.profile中的自定义内容导入过来. 比如支持rvm,应在.zshrc增加:

[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm

并自定义.zhsrc文件, 比如更换theme.完整的theme方案列表在这里

export ZSH_THEME="robbyrussell"  

整合rails3开发常用插件

安装git,rails,ruby,rvm等rails开发常用的插件.请注意,oh-my-zsh的plugins目录下面有rails与rails3两个,如果希望支持rails3,是:

plugins=(rails3 rails git textmate ruby rvm gem git github brew bundler textmate pow)

这些插件的用法参考oh-my-zsh的wiki

如需查看已经安装或者安装plugins,在这里:

cd ~/.oh-my-zsh/plugins

修改完之后,重新加载:

source ~/.zshrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment