iTerm2 + ZSH 简风设置
iTerm2 设置
-
iTerm2 => Make iTerm2 Default Term
-
iTerm2 => Preferences => Profiles
General
Working Directory => Reuse previous session's directoryColor
Color Presets... => Solarized DarkText
Change Font => Meslo LG M Regular for Powerline (下载地址:https://github.com/powerline/fonts/blob/master/Meslo%20Slashed/Meslo%20LG%20M%20Regular%20for%20Powerline.ttf)
zsh 安装设置
- 安装Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - 安装zsh
brew install zsh - 安装autojump
brew install autojump // zshrc新增 [[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh // 生效配置 source ~/.zshrc - 安装thefuck
brew install thefuck - 安装 zsh-syntax-highlighting
brew install zsh-syntax-highlighting // 配置.zshrc文件,插入一行。 source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh // 生效配置 source ~/.zshrc - plugins
git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions // 修改zshrc plugins=(git) => plugins=(zsh-autosuggestions git)
.zshrc文件的变化
export PATH=$HOME/bin:/usr/local/bin:$PATH
source ~/.bash_profile
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
eval $(thefuck --alias)
ZSH_THEME="agnoster"
plugins=(zsh-autosuggestions git)
alias cls='clear'
alias ll='ls -l'
alias la='ls -a'
alias vi='vim'
alias javac="javac -J-Dfile.encoding=utf8"
alias grep="grep --color=auto"
alias -s js=vi
alias -s c=vi
alias -s java=vi
alias -s txt=vi
alias -s gz='tar -xzvf'
alias -s tgz='tar -xzvf'
alias -s zip='unzip'
alias -s bz2='tar -xjvf'
[[ -s ~/.autojump/etc/profile.d/autojump.sh ]] && . ~/.autojump/etc/profile.d/autojump.sh
到这里就差不多能用了,但是呢,这个常长长的计算机名看着真是不舒服,去掉!!
修改光标前的计算机名
- cd ~/.oh-my-zsh/themes
- vim agnoster.zsh-theme,搜到 USER@%m 这里的%m就是机器名,删。我是前端改成@fe