在vim的偏好设置----描述文件----高级----Terminfo-----声明终端为xterm-256color
另外附上bash设置
set nocompatible
colorscheme solarized
set t_Co=256
let g:solarized_termcolors=256
set number
set statusline=2
set shiftwidth=4 " 设定 << 和 >> 命令移动时的宽度为 4
set softtabstop=4 " 使得按退格键时可以一次删掉 4 个空格
set expandtab
set tabstop=4 " 设定 tab 长度为 4
set nobackup " 覆盖文件时不备份
set autochdir " 自动切换当前目录为当前文件所在的目录
filetype plugin indent on " 开启插件
set backupcopy=yes " 设置备份时的行为为覆盖
set ignorecase smartcase " 搜索时忽略大小写,但在有一个或以上大写字母时仍保持对大小写敏感
set nowrapscan " 禁止在搜索到文件两端时重新搜索
set incsearch " 输入搜索内容时就显示搜索结果
set hlsearch " 搜索时高亮显示被找到的文本
set noerrorbells " 关闭错误信息响铃
set novisualbell " 关闭使用可视响铃代替呼叫
set t_vb= " 置空错误铃声的终端代码
syntax on " 自动语法高亮
hi Normal ctermbg=NONE ctermfg=white
set cscopequickfix=s-,c-,d-,i-,t-,e-
if has("cscope")
set csprg=/Users/moon/bin/cscope.sh
set csto=0
set cst
set nocsverb
if filereadable("cscope.out")
cs add cscope.out
elseif $CSCOPE_DB != ""
cs add $CSCOPE_DB
endif
set csverb
endif
map <F2> :cs find
map <F3> :cw<CR>
map <F4> :cclose<CR>
map <F5> :TlistToggle<CR>
nmap <C-c>s :cs find s <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>g :cs find g <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>c :cs find c <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>t :cs find t <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>e :cs find e <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>f :cs find f <C-R>=expand("<cword>")<CR><CR>
nmap <C-c>i :cs find i ^<C-R>=expand("<cword>")<CR>$<CR>
nmap <C-c>d :cs find d <C-R>=expand("<cword>")<CR><CR>
nmap <C-n> :cn<CR>
nmap <C-p> :cp<CR>
vmap "+y :w !pbcopy<CR><CR>
nmap "+p :r !pbpaste<CR><CR>
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1