安装brew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
配置iterm2
①Preferences-Profiles-General-Working Directory选择Resuse previous session's directory,新建窗口的时候跟随上次的目录
②最新版iterm2自带Solarized配色,直接在Preferences-Profiles-Colors-Color Presets中选择就可以了
③Preferences-Profiles-Text-Cursor选择Vertical Bar,光标变成竖线
④Preferences-Profiles-Text,去掉Draw bold text in bright colors,否则Solarized主题不生效
⑤Preferences-Keys-Hotkey,设置一组热键用于显示或隐藏
配置颜色
下载Solarized
git clone https://github.com/altercation/solarized
配置VIM颜色
$ cd solarized
$ cd vim-colors-solarized/colors
$ mkdir -p ~/.vim/colors
$ cp solarized.vim ~/.vim/colors/
$ vi ~/.vimrc 添加以下代码
syntax on
set background=dark
colorscheme solarized
配置ls颜色
$ sudo brew install xz coreutils
$ gdircolors --print-database > ~/.dir_colors
$ vim ~/.bash_profile 添加以下代码
if brew list | grep coreutils > /dev/null ; then
PATH="$(brew --prefix coreutils)/libexec/gnubin:$PATH"
alias ls='ls -F --show-control-chars --color=auto'
eval `gdircolors -b $HOME/.dir_colors`
fi
配置grep高亮
alias grep='grep --color'
alias egrep='egrep --color'
alias fgrep='fgrep --color'
配置自定义命令
alias ll='ls -al'
alias vi='vim'
自动补全
brew install bash-completion
#.bash_profile里添加
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
下载git自动补全脚本
cd /usr/local/Cellar/bash-completion/1.3_3/etc/bash_completion.d
wget https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash
brew unlink bash-completion && brew link bash-completion
没生效就重启bash
Tmux
待续