我的Vim设置存档

两套vim设置,一套用于windwos,另外一套用于Linux

Linux下的vim设置,建立~/.vim/plugin目录下创建一个文本文件"mcfg.vim",vim/gvim启动时会自动加载
java 代码
 
  1. " ------------------------------------------------------------------------- 
  2. " My Vim Configuration  
  3. " ------------------------------------------------------------------------- 
  4.  
  5. " -------------------------------------------------------------------------  
  6. " Common Settings 
  7. " -------------------------------------------------------------------------  
  8. set nocompatible                        " Use vim advance settings 
  9. set autoindent                          " Auto-indent on  
  10. set tabstop=4                           " Use 4 spaces for tabs 
  11. set shiftwidth=2                        " 2 spaces for autoindent  
  12. set expandtab                           " Use space instead of tabs 
  13. "set foldcolumn=4                       " Colums for fold display 
  14. "set incsearch                          " Incremental search 
  15. "set hlsearch                           " Highlight search hits 
  16. set showcmd                             " Show panding commands  
  17. set cmdheight=1                         " lines for command window 
  18. set laststatus=2                        " Always show status line  
  19. set backspace=indent,eol,start          " Backspace over everyting 
  20. set history=50                          " Save at most 50 commands  
  21. "set ruler                              " show ruler  
  22. "set showmatch                          " Display matching paren  
  23. "set matchtime=2                        " Be breif when displaying the match  
  24. set nobackup                            " No backups 
  25. set visualbell                          " Use visual bell  
  26. "set mouse=nv                           " Mouse in normal and visual  
  27. "set viminfo='100,f1,rE:,:100,/100      " Vim info options  
  28. set lazyredraw                          " Don't redraw on macro execute 
  29. set noerrorbells                        " Don't make noise  
  30. set autoread                            " Re-read if modified 
  31. "set backupcopy=yes                     " Save resources 
  32. set diffopt=filler,iwhite               " Diff options  
  33. set nostartofline                       " Keep cursor column when moving 
  34. set number                              " Show number of line on left  
  35. set helplang=cn,en                      " Language of help 
  36. set enc=UTF-8 
  37. set fenc=UTF-8 
  38. set fencs=UTF-8,chinese 
  39. syntax on                               " Syntax Highlight on  
  40.   
  41.   
  42. "-------------------------------------------------------------------------- 
  43. " Options for Graphic version of VIM  
  44. "-------------------------------------------------------------------------- 
  45. set guioptions-=T           " No Toolbar  
  46. set guioptions-=L           " No left hand scrollbars 
  47. set guioptions-=r           " No right hand scrollbars  
  48. set guioptions-=m           " No menu bar 
  49.  
  50.  
  51. "--------------------------------------------------------------------------  
  52. " Auto commands 
  53. "--------------------------------------------------------------------------  
  54. filetype plugin indent on   " Enable file type indenting and plugins 
  55. set browsedir=buffer 
  56. set autochdir 
  57.  
  58.  
  59. "--------------------------------------------------------------------------  
  60. " Color scheme 
  61. "--------------------------------------------------------------------------  
  62. "set t_Co=256 
  63. "colorscheme murphy  
  64. colorscheme vibrantink              "simulate TextMate color scheme
  65. "highlight StatusLine gui=none 
  66. "highlight SpecialKey guibg=bg  
  67. "highlight Folded     gui=none 
  68. "highlight Boolean    gui=none  
  69.   
  70.   
  71. " ------------------------------------------------------------------------- 
  72. " Other  
  73. " ------------------------------------------------------------------------- 
  74. auto BufEnter * let &titlestring = expand("%:p") . " (" . &ft .":" . &fenc . ") "   
其中vibrantink是在网上的一个模拟TextMate的配色方案的脚本,没有的情况下用系统自带的murphy也很不错。


Windwos下的vim设置,在vim安装根目录下创建或编辑"_vimrc"文件:
java 代码
 
  1. " ------------------------------------------------------------------------- 
  2. " My Vim Configuration  
  3. " ------------------------------------------------------------------------- 
  4.  
  5. " -------------------------------------------------------------------------  
  6. " Common Settings 
  7. " -------------------------------------------------------------------------  
  8. set nocompatible                        " Use vim advance settings 
  9. set autoindent                          " Auto-indent on  
  10. set tabstop=4                           " Use 4 spaces for tabs 
  11. set shiftwidth=2                        " 2 spaces for autoindent  
  12. set expandtab                           " Use space instead of tabs 
  13. "set foldcolumn=4                       " Colums for fold display 
  14. "set incsearch                          " Incremental search 
  15. "set hlsearch                           " Highlight search hits 
  16. set showcmd                             " Show panding commands  
  17. set cmdheight=1                         " lines for command window 
  18. set laststatus=2                        " Always show status line  
  19. set backspace=indent,eol,start          " Backspace over everyting 
  20. set history=50                          " Save at most 50 commands  
  21. "set ruler                              " show ruler  
  22. "set showmatch                          " Display matching paren  
  23. "set matchtime=2                        " Be breif when displaying the match  
  24. set nobackup                            " No backups 
  25. set visualbell                          " Use visual bell  
  26. "set mouse=nv                           " Mouse in normal and visual  
  27. "set viminfo='100,f1,rE:,:100,/100      " Vim info options  
  28. set lazyredraw                          " Don't redraw on macro execute 
  29. set noerrorbells                        " Don't make noise  
  30. set autoread                            " Re-read if modified 
  31. "set backupcopy=yes                     " Save resources 
  32. set diffopt=filler,iwhite               " Diff options  
  33. set nostartofline                       " Keep cursor column when moving 
  34. set number                              " Show number of line on left  
  35. set helplang=cn,en                      " Language of help 
  36. set enc=cp936                           " cp936 in Winxp  
  37. set fenc=UTF-8  
  38. set fencs=UTF-8,chinese  
  39. syntax on                               " Syntax Highlight on 
  40.  
  41.  
  42. "--------------------------------------------------------------------------  
  43. " Options for Graphic version of VIM 
  44. "--------------------------------------------------------------------------  
  45. set guioptions-=T           " No Toolbar 
  46. set guioptions-=L           " No left hand scrollbars  
  47. set guioptions-=r           " No right hand scrollbars 
  48. set guioptions-=m           " No menu bar  
  49.   
  50.   
  51. "-------------------------------------------------------------------------- 
  52. " Auto commands  
  53. "-------------------------------------------------------------------------- 
  54. filetype plugin indent on   " Enable file type indenting and plugins  
  55. set browsedir=buffer  
  56. set autochdir  
  57.   
  58.   
  59. "-------------------------------------------------------------------------- 
  60. " Color scheme  
  61. "-------------------------------------------------------------------------- 
  62. "set t_Co=256  
  63. colorscheme murphy  
  64. "colorscheme vibrantink 
  65. "highlight StatusLine gui=none  
  66. "highlight SpecialKey guibg=bg 
  67. "highlight Folded     gui=none  
  68. "highlight Boolean    gui=none 
  69.  
  70.  
  71. " -------------------------------------------------------------------------  
  72. " Other 
  73. " -------------------------------------------------------------------------  
  74. auto BufEnter * let &titlestring = expand("%:p") . " (" . &ft .":" . &fenc . ") "   

你可能感兴趣的:(linux,脚本,Scheme,vim)