Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1246446
  • 博文数量: 105
  • 博客积分: 127
  • 博客等级: 入伍新兵
  • 技术积分: 962
  • 用 户 组: 普通用户
  • 注册时间: 2011-01-29 15:22
文章分类

全部博文(105)

文章存档

2021年(1)

2019年(3)

2018年(1)

2017年(11)

2016年(47)

2015年(32)

2014年(4)

2012年(6)

我的朋友

分类: LINUX

2015-11-03 15:14:29

用了这么的VIM ,一直都在使用不同的VIMRC。mark 一下这个版本的,可以称之为 vimrc_GodWithYou
有图有真相,先上图。

点击(此处)折叠或打开

  1. """""""""""""""""""
  2. "
  3. """""""""""""""""""
  4. "set shortmess=atI "
  5. "winpos 5 5 "
  6. "set lines=40 columns=155 "
  7. "set nu "
  8. set go= "
  9. "color asmanian2 "
  10. set guifont=Courier_New:h10:cANSI "
  11. "syntax on "
  12. autocmd InsertLeave * se nocul "
  13. autocmd InsertEnter * se cul "
  14. "set ruler "
  15. set showcmd "
  16. "set cmdheight=1 " 1
  17. "set whichwrap+=<,>,h,l " backspace()
  18. "set scrolloff=3 " buffer3
  19. set novisualbell " ()
  20. set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} "
  21. set laststatus=1 " (1),(2)
  22. set foldenable "
  23. set foldmethod=manual "
  24. "set background=dark "
  25. set nocompatible "vibug
  26. "
  27. if version >= 603
  28. set helplang=cn
  29. set encoding=utf-8
  30. endif
  31. colorscheme ron
  32. "
  33. "colorscheme murphy
  34. "
  35. "if (has("gui_running"))
  36. " set guifont=Bitstream\ Vera\ Sans\ Mono\ 10
  37. "endif
  38. set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
  39. set termencoding=utf-8
  40. set encoding=utf-8
  41. set fileencodings=ucs-bom,utf-8,cp936
  42. set fileencoding=utf-8
  43. """""""""""""""""""""""""
  44. """""""""""""""
  45. ".c,.h,.sh,.java
  46. autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()"
  47. ""SetTitle
  48. func SetTitle()
  49. ".sh
  50. if &filetype == 'sh'
  51. call setline(1,"\#########################################################################")
  52. call append(line("."), "\#")
  53. call append(line(".")+1, "\# _ooOoo_")
  54. call append(line(".")+2, "\# o8888888o")
  55. call append(line(".")+3, "\# 88\" . \"88")
  56. call append(line(".")+4, "\# (| -_- |)")
  57. call append(line(".")+5, "\# O\\ = /O")
  58. call append(line(".")+6, "\# ____/`---'\\____")
  59. call append(line(".")+7, "\# .' \\\| |// `.")
  60. call append(line(".")+8, "\# / \\\||| : |||// \\")
  61. call append(line(".")+9, "\# / _||||| -:- |||||- \\")
  62. call append(line(".")+10, "\# | | \\\\ - /// | |")
  63. call append(line(".")+11, "\# | \\_| ''\\---/'' | |")
  64. call append(line(".")+12, "\# \\ .-\\__ `-` ___/-. /")
  65. call append(line(".")+13, "\# ___`. .' /--.--\\ `. . __")
  66. call append(line(".")+14, "\# .\"\" '< `.___\\_<|>_/___.' >'\"\".")
  67. call append(line(".")+15, "\# | | : `- \\`.;`\ _ /`;.`/ - ` : | |")
  68. call append(line(".")+16, "\# \\ \\ `-. \\_ __\\ /__ _/ .-` / /")
  69. call append(line(".")+17, "\#======`-.____`-.___\\_____/___.-`____.-'======")
  70. call append(line(".")+18, "\# `=---='")
  71. call append(line(".")+19, "\#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
  72. call append(line(".")+20, "\# GOD BLESS NEVER BUG")
  73. call append(line(".")+21, "\#")
  74. call append(line(".")+22, "\# Author: test")
  75. call append(line(".")+23, "\# mail: mailto:test@jbxue.com test@jbxue.com")
  76. call append(line(".")+24, "\# Created Time: ".strftime("%c"))
  77. call append(line(".")+25, "\#########################################################################")
  78. call append(line(".")+26, "\#!/bin/bash")
  79. call append(line(".")+27, "")
  80. else
  81. call setline(1, "/*************************************************************************")
  82. call append(line("."), " ")
  83. call append(line(".")+1, " _ooOoo_")
  84. call append(line(".")+2, " o8888888o")
  85. call append(line(".")+3, " 88\" . \"88")
  86. call append(line(".")+4, " (| -_- |)")
  87. call append(line(".")+5, " O\\ = /O")
  88. call append(line(".")+6, " ____/`---'\\____")
  89. call append(line(".")+7, " .' \\\| |// `.")
  90. call append(line(".")+8, " / \\\||| : |||// \\")
  91. call append(line(".")+9, " / _||||| -:- |||||- \\")
  92. call append(line(".")+10, " | | \\\\ - /// | |")
  93. call append(line(".")+11, " | \\_| ''\\---/'' | |")
  94. call append(line(".")+12, " \\ .-\\__ `-` ___/-. /")
  95. call append(line(".")+13, " ___`. .' /--.--\\ `. . __")
  96. call append(line(".")+14, " .\"\" '< `.___\\_<|>_/___.' >'\"\".")
  97. call append(line(".")+15, " | | : `- \\`.;`\ _ /`;.`/ - ` : | |")
  98. call append(line(".")+16, " \\ \\ `-. \\_ __\\ /__ _/ .-` / /")
  99. call append(line(".")+17, "======`-.____`-.___\\_____/___.-`____.-'======")
  100. call append(line(".")+18, " `=---='")
  101. call append(line(".")+19, " ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
  102. call append(line(".")+20, " ###################################")
  103. call append(line(".")+21, " GOD BLESS NEVER BUG")
  104. call append(line(".")+22, "")
  105. call append(line(".")+23, " > File Name: ".expand("%"))
  106. call append(line(".")+24, " > Author: test")
  107. call append(line(".")+25, " > Mail: mailto:test@jbxue.com")
  108. call append(line(".")+26, " > Created Time: ".strftime("%c"))
  109. call append(line(".")+27, " ************************************************************************/")
  110. call append(line(".")+28, "")
  111. endif
  112. if &filetype == 'cpp'
  113. call append(line(".")+29, "#include")
  114. call append(line(".")+30, "using namespace std;")
  115. call append(line(".")+31, "")
  116. endif
  117. if &filetype == 'c'
  118. call append(line(".")+29, "#include")
  119. call append(line(".")+30, "#include")
  120. call append(line(".")+31, "#include")
  121. call append(line(".")+32, "")
  122. endif
  123. "
  124. autocmd BufNewFile * normal G
  125. endfunc
  126. """""""""""""""""""""""""""""""
  127. "
  128. """""""""""""""""""""""""""""""
  129. nmap <leader>w :w!>
  130. nmap <leader>f :find<cr>
  131. " + ctrl+a
  132. map ggVGY
  133. map! ggVGY
  134. map gg=G
  135. " Ctrl+c
  136. vmap <C-c> "+y
  137. "
  138. nnoremap <F2> :g/^\s*$/d<CR>
  139. "
  140. nnoremap :vert diffsplit
  141. "
  142. map <M-F2> :tabnew<CR>
  143. "
  144. map :tabnew .
  145. "
  146. map <C-F3> \be
  147. "CC++ F5
  148. map :call CompileRunGcc()
  149. func! CompileRunGcc()
  150. exec "w"
  151. if &filetype == 'c'
  152. exec "!g++ % -o %<"
  153. exec "! ./%<"
  154. elseif &filetype == 'cpp'
  155. exec "!g++ % -o %<"
  156. exec "! ./%<"
  157. elseif &filetype == 'java'
  158. exec "!javac %"
  159. exec "!java %<"
  160. elseif &filetype == 'sh'
  161. :!./%
  162. endif
  163. endfunc
  164. "C,C++
  165. map <F8> :call Rungdb()<CR>
  166.  Rungdb()
  167. exec "w"
  168. exec "!g++ % -g -o %<"
  169. exec "!gdb ./%<"
  170. endfunc
  171. """"""""""""""""""""""""
  172. ""
  173. """"""""""""""""""""""""
  174. "
  175. set autoread
  176. " quickfix
  177. autocmd FileType c,cpp map <buffer> <leader><space> :w<cr>:make<cr>
  178. "
  179. set completeopt=preview,menu
  180. "
  181. filetype plugin on
  182. "
  183. set clipboard+=unnamed
  184. "
  185. set nobackup
  186. "make
  187. :set makeprg=g++\ -Wall\ \ %
  188. "
  189. set autowrite
  190. set ruler "
  191. set cursorline "
  192. set magic "
  193. set guioptions-=T "
  194. set guioptions-=m "
  195. "set statusline=\ %<%F[%1*%M%*%n%R%H]%=\ %y\ %0(%{&fileformat}\ %{&encoding}\ %c:%l/%L%)\
  196. "
  197. " donot need fold
  198. "set foldcolumn=0
  199. "set foldmethod=indent
  200. "set foldlevel=3
  201. "set foldenable "
  202. " vivim
  203. set nocompatible
  204. "
  205. set syntax=on
  206. "
  207. set noeb
  208. "
  209. set confirm
  210. "
  211. set autoindent
  212. set cindent
  213. " Tab
  214. set tabstop=4
  215. " 4
  216. set softtabstop=4
  217. set shiftwidth=4
  218. "
  219. set noexpandtab
  220. "
  221. set smarttab
  222. "
  223. set number
  224. "
  225. set history=1000
  226. "
  227. set nobackup
  228. set noswapfile
  229. "
  230. set ignorecase
  231. "
  232. set hlsearch
  233. set incsearch
  234. "
  235. set gdefault
  236. "
  237. set enc=utf-8
  238. set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
  239. "
  240. set langmenu=zh_CN.UTF-8
  241. set helplang=cn
  242. "
  243. "set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")}
  244. "set statusline=[%F]%y%r%m%*%=[Line:%l/%L,Column:%c][%p%%]
  245. "
  246. set laststatus=2
  247. " 12
  248. set cmdheight=2
  249. "
  250. filetype on
  251. "
  252. filetype plugin on
  253. "
  254. filetype indent on
  255. "
  256. set viminfo+=!
  257. "
  258. set iskeyword+=_,$,@,%,#,-
  259. "
  260. set linespace=0
  261. "
  262. set wildmenu
  263. " backspaceindent, eol, start
  264. set backspace=2
  265. " backspace
  266. set whichwrap+=<,>,h,l
  267. " bufferoffice
  268. "ispsubb 20141105
  269. "set mouse=a
  270. set selection=exclusive
  271. set selectmode=mouse,key
  272. " : commands
  273. set report=0
  274. "
  275. set fillchars=vert:\ ,stl:\ ,stlnc:\
  276. "
  277. set showmatch
  278. "
  279. set matchtime=1
  280. " buffer3
  281. set scrolloff=3
  282. " C
  283. set smartindent
  284. " txttxt.vim
  285. au BufRead,BufNewFile * setfiletype txt
  286. "
  287. "":inoremap ( ()<ESC>i
  288. "":inoremap ) <c-r>=ClosePair(')')<CR>
  289. "":inoremap { {<CR>}<ESC>O
  290. "":inoremap } <c-r>=ClosePair('}')<CR>
  291. "":inoremap [ []<ESC>i
  292. "":inoremap ] <c-r>=ClosePair(']')<CR>
  293. "":inoremap " ""i
  294. "":inoremap ' ''i
  295. ""function! ClosePair(char)
  296. ""if getline('.')[col('.') - 1] == a:char
  297. ""return "\<Right>"
  298. ""else
  299. ""return a:char
  300. ""endif
  301. ""endfunction
  302. filetype plugin indent on
  303. ",
  304. set completeopt=longest,menu
  305. """"""""""""""""""""""""""""""""
  306. " CTags
  307. """"""""""""""""""""""""""""""""
  308. let Tlist_Sort_Type = "name" "
  309. let Tlist_Use_Right_Window = 1 "
  310. let Tlist_Compart_Format = 1 "
  311. let Tlist_Exist_OnlyWindow = 1 " bufferkillkillbuffer
  312. let Tlist_File_Fold_Auto_Close = 0 " tags
  313. let Tlist_Enable_Fold_Column = 0 "
  314. autocmd FileType java set tags+=D:\tools\java\tags
  315. "autocmd FileType h,cpp,cc,c set tags+=D:\tools\cpp\tags
  316. "let Tlist_Show_One_File=1 "tag
  317. "tags
  318. set tags=tags
  319. "set autochdir
  320. """""""""""""""""""""""""
  321. "
  322. """""""""""""""""""""""""
  323. "Taglist
  324. let Tlist_Auto_Open=1
  325. """"""""""""""""""""""""""""""
  326. " Tag list (ctags)
  327. """"""""""""""""""""""""""""""""
  328. let Tlist_Ctags_Cmd = '/usr/bin/ctags'
  329. let Tlist_Show_One_File = 1 "tag
  330. let Tlist_Exit_OnlyWindow = 1 "taglistvim
  331. let Tlist_Use_Right_Window = 1 "taglist
源码如下:vimrc_godwithyou.rar

阅读(7204) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~