use zsh

4th/7/2015

To hide username@computername both in local and ssh login mode

Add following lines in .zshrc

1
2
3
prompt_context() {
# empty function to override agnoster.theme render username@computername function
}

Auto switch theme when ssh login

Change theme line in .zshrc to following lines

1
2
3
4
5
if [[ -n "$SSH_CLIENT" ]]; then
ZSH_THEME="ys"
else
ZSH_THEME="agnoster"
fi

Install font on iOS device

Update May 28, 2015

Using agnoster

  1. Install powerline/fonts

  2. Change iterm2 font to Ubuntu Mono Derivative Powerline reference

  3. Add DEFAULT_USER=zx in ~/.zshrc to hide username@localhost

  4. Make theme like screenshot
    image

    1
    $ wget https://raw.github.com/altercation/solarized/master/iterm2-colors-solarized/Solarized%20Dark.itermcolors

    iTerm -> Profiles -> Colors ->
    Load Presets... -> Import... -> Solarized Dark.itermcolors


Install oh-my-zsh by running follow command

1
2
3
4
5
# via curl
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# via wget
$ sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"

Download iTerm2

Instead I went to iTerm2 -> Preferences -> Profiles -> Default and in the General Tab set the Command to /bin/zsh instead of Login shell

显示中文

1
2
3
4
5
6
cd ~
vi .zshrc
/en_US
#remove the #
:wq
source .zshrc

install autojump

1
2
3
4
5
6
7
8
9
git clone git://github.com/joelthelion/autojump.git
cd autojump
./install.py
vi ~/.zshrc
#paste
[[ -s /Users/[ME]]/.autojump/etc/profile.d/autojump.sh ]] && source /Users/[ME]/.autojump/etc/profile.d/autojump.sh
# to the last of .zshrc
#Please restart terminal(s) before running autojump.