iTerm2 + ZSH 簡風設定
iTerm2 設定
-
iTerm2 => Make iTerm2 Default Term
-
iTerm2 => Preferences => Profiles
General
Working Directory => Reuse previous session's directory 複製程式碼
Color
Color Presets... => Solarized Dark 複製程式碼
Text
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