作者 karron [actionscript] 2007-01-24 22:26 (点击下载)

  1. "source $VIMRUNTIME/vimrc_example.vim
  2. set nocompatible
  3. if !exists("syntax_on")
  4. syntax on
  5. endif
  6. "set runtimepath+=/data/setup/vim/snippetsEmu
  7. "set runtimepath+=/data/setup/vim/snippetsEmu/after
  8. "let b:html_tag_case="lowercase"
  9.  
  10.  
  11. "设置tab字符个数
  12. set tabstop=2
  13. set shiftwidth=2
  14. set nu
  15. " 设置行号留空大小
  16. set nuw=1
  17. set fdc=0
  18.  
  19.  
  20. "自动缩进
  21. set autoindent
  22. "更方便的退格键
  23. set backspace=2
  24.  
  25. "设置fold栏位宽度为0,我不使用fold,感觉总有问题,不爽
  26. set fdc=2
  27. "自动检测文件类型
  28. filetype on
  29. filetype plugin on
  30.  
  31. "映射F8为显示列表,需要taglist插件
  32. nnoremap <silent> <F8> :Tlist<CR>
  33. " 让Taglist的窗口在右边
  34. let Tlist_Use_Right_Window=1
  35. " 不让其改变窗口大小
  36. let Tlist_Inc_Winwidth=0
  37. "映射F5为make指令
  38. nnoremap <silent> <F5> :w<CR>:make<CR>
  39.  
  40. "配色文件
  41. if (has("gui_running"))
  42. "colorscheme inkpot
  43. else
  44. colorscheme ron
  45. endif
  46.  
  47. "if ((has("gui_running")))
  48. " color ps_color
  49. " Colo warm
  50. "else
  51. " color ron
  52. " "color ps_color
  53. " "Colo cool
  54. "endif
  55.  
  56. "对python文件进行特殊设置
  57. if has("autocmd")
  58. filetyp plugin indent on
  59. autocmd FileType python setlocal et | setlocal sta | setlocal sw=4
  60. autocmd FileType python compiler pyunit
  61. autocmd FileType python setlocal makeprg=python\ %
  62. autocmd FileType python set omnifunc=pythoncomplete#Complete
  63. autocmd BufNewFile *.py 0r ~/project/template.py
  64. endif
  65. "au FileType python source .vim/plugin/python.vim
  66.  
  67. "字体
  68. if (has("gui_running"))
  69. " set guifont=Bitstream\ Vera\ Sans\ Mono\ 11
  70. set guifont=Consolas\ 11
  71. endif
  72.  
  73. " 禁用netrw,这个似乎是读写网络文件的
  74. ":let loaded_netrw = 1
  75.  
  76. "----------------below for txt file
  77. "让文本文件也有高亮,thanks to xbeta@smth
  78. augroup filetypedetect
  79. "au BufNewFile,BufRead *.* setf txt
  80. "缓冲区写入文件的时候自动检查文件类型
  81. au BufWritePost * filet detect
  82.  
  83. "配置reStructured Text文件类型
  84. au BufNewFile,BufRead *.vst set ft=rest
  85. augroup END
  86. "设定文件编码类型,彻底解决中文编码问题
  87. let &termencoding=&encoding
  88. set fileencodings=utf-8,gbk,ucs-bom,cp936,big5,utf-16,euc-jp
  89.  
  90. " 中文帮助
  91. if version > 603
  92. set helplang=cn
  93. endi
  94. " Only do this part when compiled with support for autocommands
  95. if has("autocmd")
  96. " In text files, always limit the width of text to 78 characters
  97. autocmd BufRead *.txt set tw=78
  98. " When editing a file, always jump to the last cursor position
  99. autocmd BufReadPost *
  100. \ if line("'\"") > 0 && line ("'\"") <= line("$") |
  101. \ exe "normal g'\"" |
  102. \ endif
  103. endif
  104.  
  105. if has("autocmd") && exists("+omnifunc")
  106. autocmd Filetype *
  107. \ if &omnifunc == "" |
  108. \ setlocal omnifunc=syntaxcomplete#Complete |
  109. \ endif
  110. endif
  111.  
  112.  
  113. " ruby
  114. filetype plugin indent on " Enable filetype-specific indenting and plugins
  115.  
  116. " Load matchit (% to bounce from do to end, etc.)
  117. runtime! macros/matchit.vim
  118. augroup myfiletypes
  119. "autocmd! " Clear old autocmds in group
  120. " autoindent with two spaces, always expand tabs
  121. autocmd FileType ruby,eruby,yaml set ai sw=2 sts=2 et
  122. augroup END
  123.  
  124. autocmd FileType ruby,eruby set omnifunc=rubycomplete#Complete
  125. autocmd FileType ruby,eruby let g:rubycomplete_buffer_loading = 1
  126. autocmd FileType ruby,eruby let g:rubycomplete_rails = 1
  127. autocmd FileType ruby,eruby let g:rubycomplete_classes_in_global = 1
  128.  
  129.  
  130. "" Encoding settings
  131. "if has("multi_byte")
  132. " " Set fileencoding priority
  133. " if getfsize(expand("%")) > 0
  134. " set fileencodings=ucs-bom,utf-8,cp936,big5,euc-jp,euc-kr,latin1
  135. " else
  136. " set fileencodings=cp936,big5,euc-jp,euc-kr,latin1
  137. " endif
  138. "
  139. " " CJK environment detection and corresponding setting
  140. " if v:lang =~ "^zh_CN"
  141. " " Use cp936 to support GBK, euc-cn == gb2312
  142. " set encoding=cp936
  143. " set termencoding=cp936
  144. " set fileencoding=cp936
  145. " elseif v:lang =~ "^zh_TW"
  146. " " cp950, big5 or euc-tw
  147. " " Are they equal to each other?
  148. " set encoding=big5
  149. " set termencoding=big5
  150. " set fileencoding=big5
  151. " elseif v:lang =~ "^ko"
  152. " " Copied from someone's dotfile, untested
  153. " set encoding=euc-kr
  154. " set termencoding=euc-kr
  155. " set fileencoding=euc-kr
  156. " elseif v:lang =~ "^ja_JP"
  157. " " Copied from someone's dotfile, unteste
  158. " set encoding=euc-jp
  159. " set termencoding=euc-jp
  160. " set fileencoding=euc-jp
  161. " endif
  162. " " Detect UTF-8 locale, and replace CJK setting if needed
  163. " if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
  164. " set encoding=utf-8
  165. " set termencoding=utf-8
  166. " set fileencoding=utf-8
  167. " endif
  168. "else
  169. " echoerr "Sorry, this version of (g)vim was not compiled with multi_byte"
  170. "endif
  171. "
  172. "

提交下面的校正或者修改. (点击这里开始一个新的帖子)
姓名: 在 cookie 中记住我的名字

屏幕抓图:(jpeg 或 png)