一、设置bash:


vim ~/.bash_profile

  # OSX terminal彩色设置

  export CLICOLOR=1

  export LSCOLORS=GxFxCxDxBxegedabagaced

  export PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\$ '

  # ll

  alias ll='ls -l'



二、设置vim:


从下面地址下载vim的配色文件:

https://github.com/tomasr/molokai


vim ~/.vimrc

  1 " Configuration file for vim

  2 set modelines=0   " CVE-2007-2438

  3 

  4 " Normally we use vim-extensions. If you want true vi-compatibility

  5 " remove change the following statements

  6 set nocompatible  " Use Vim defaults instead of 100% vi compatibility

  7 set backspace=2   " more powerful backspacing

  8 

  9 " Don't write backup file if vim is being called by "crontab -e"

 10 au BufWrite /private/tmp/crontab.* set nowritebackup nobackup

 11 " Don't write backup file if vim is being called by "chpass"

 12 au BufWrite /private/etc/pw.* set nowritebackup nobackup

 13 

 14 colorscheme molokai

 15 syn on "语法支持

 16 set laststatus=2 "始终显示状态栏

 17 set tabstop=2 "一个制表符的长度

 18 set softtabstop=2 "一个制表符的长度(可以大于tabstop)

 19 set shiftwidth=2 "一个缩进的长度

 20 set expandtab "使用空格替代制表符

 21 set smarttab "智能制表符

 22 set autoindent "自动缩进

 23 set smartindent "只能缩进

 24 set number "显示行号

 25 set ruler "显示位置指示器

 26 set backupdir=/tmp "设置备份文件目录

 27 set directory=/tmp "设置临时文件目录

 28 set ignorecase "检索时忽略大小写

 29 set hls "检索时高亮显示匹配项

 30 set helplang=cn "帮助系统设置为中文

 31 set foldmethod=syntax "代码折叠

 32 

 33 

 34 " 开关文件浏览器

 35 map <D-1> :NERDTreeToggle <CR>

 36 " 在文件浏览器中定位当前文件

 37 map <D-!> :NERDTreeFind <CR>

 38 " 关闭文件时同时关闭文件浏览器

 39 let NERDTreeQuitOnOpen = 1

 40 

 41 " 打开文件定位窗口

 42 nnoremap <slient> <D-R> :CommandT<CR>

 43 " 打开最近打开的文件列表

 44 nnoremap <slient> <D-E> :CommandTBuffer<CR>