Guest User

Untitled

a guest
Jan 21st, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. set nocompatible
  2.  
  3. filetype off
  4.  
  5. "activate pathogen
  6. call pathogen#runtime_append_all_bundles()
  7. call pathogen#helptags()
  8.  
  9. filetype plugin indent on
  10.  
  11. "allow backspacing over everything in insert mode
  12. set backspace=indent,eol,start
  13.  
  14. function! MySys()
  15. if has("win32")
  16. return "windows"
  17. else
  18. return "linux"
  19. endif
  20. endfunction
  21.  
  22. if MySys() == 'linux'
  23. "When .vimrc is edited, reload it
  24. autocmd! bufwritepost vimrc source ~/.vimrc
  25. autocmd! bufwritepost .vimrc source ~/.vimrc
  26. elseif MySys() == 'windows'
  27. "When _vimrc is edited, reload it
  28. autocmd! bufwritepost _vimrc source $vim/_vimrc
  29. behave mswin
  30. source $VIMRUNTIME/vimrc_example.vim
  31. set ch=2 " Make command line two lines high
  32. set mousehide " Hide the mouse when typing text
  33. " Make shift-insert work like in Xterm
  34. map <S-Insert> <MiddleMouse>
  35. map! <S-Insert> <MiddleMouse>
  36. au GUIEnter * simalt ~x
  37. "source $VIMRUNTIME/mswin.vim
  38.  
  39. "set diffexpr=MyDiff()
  40. "function MyDiff()
  41. "let opt = '-a --binary '
  42. "if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif
  43. "if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif
  44. "let arg1 = v:fname_in
  45. "if arg1 =~ ' ' | let arg1 = '"' . arg1 . '"' | endif
  46. "let arg2 = v:fname_new
  47. "if arg2 =~ ' ' | let arg2 = '"' . arg2 . '"' | endif
  48. "let arg3 = v:fname_out
  49. "if arg3 =~ ' ' | let arg3 = '"' . arg3 . '"' | endif
  50. "let eq = ''
  51. "if $VIMRUNTIME =~ ' '
  52. "if &sh =~ '\<cmd'
  53. "let cmd = '""' . $VIMRUNTIME . '\diff"'
  54. "let eq = '"'
  55. "else
  56. "let cmd = substitute($VIMRUNTIME, ' ', '" ', '') . '\diff"'
  57. "endif
  58. "else
  59. "let cmd = $VIMRUNTIME . '\diff'
  60. "endif
  61. "silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq
  62. "endfunction
  63. endif
  64.  
  65. set fileencodings=ucs-bom,utf-8,chinese,big5,latin1
  66.  
  67. syntax on
  68. "set number
  69. set nospell
  70. set linebreak
  71. set showbreak=...
  72. set nowrap
  73. set hlsearch
  74. set shiftwidth=2
  75. set sts=2
  76. set tabstop=2
  77. set expandtab
  78. "c indent = 4 whitespace
  79. set cindent shiftwidth=4
  80. set autoindent shiftwidth=2
  81. "highlight word according to the language
  82.  
  83. colorscheme lk
  84. "colorscheme railscasts
  85. "autocmd BufNewFile,BufRead *.rb source ~/.vim/scripts/rubysnippets.vim
  86.  
  87.  
  88. if MySys() == 'linux'
  89. set listchars=tab:▸\ ,eol:¬
  90. "set listchars=eol:¬
  91. set list
  92. endif
  93.  
  94. if MySys() == 'linux'
  95. set guifont=DejaVu\ Sans\ Mono\ 10
  96. endif
  97.  
  98. if MySys() == 'windows'
  99. set guifont=DejaVu_Sans_Mono:h10.5:cANSI
  100. "set guifont=Monaco:h10.5:cANSI
  101. "set guiont=Bitstream_Vera_Sans_Mono:h10.5:cANSI
  102. "set gfw=Microsoft\ Yahei\ 12:h10.5:cGB2312
  103. endif
  104.  
  105.  
  106. set bsdir=last
  107.  
  108. set tags=tags;
  109.  
  110.  
  111. "let mapleader='\'
  112. "nmap fb :NERDTree<cr>
  113. "nmap ff vbw"+y:/<C-V><cr>
  114. "nmap fl :TlistToggle<cr>
  115.  
  116. if v:version >= 730
  117. set undofile
  118. set ul=500
  119. set cwh=25
  120. endif
  121.  
  122. "------------------------plugins------------------------"
  123.  
  124. "MBF
  125. let g:miniBufExplMapWindowNavVim = 1
  126. let g:miniBufExplMapWindowNavArrows = 1
  127. let g:miniBufExplMapCTabSwitchBufs = 1
  128. let g:miniBufExplModSelTarget = 1
  129. let g:miniBufExplMaxHeight = 1
  130.  
  131.  
  132. "taglist
  133. let Tlist_Auto_Open=1
  134. let Tlist_Show_One_File = 1
  135. let Tlist_Exit_OnlyWindow = 1
  136. let Tlist_Use_Right_Window = 1
  137.  
  138. if bufwinnr(1)
  139. map <kPlus> <C-W>+
  140. map <kMinus> <C-W>-
  141. map <kDivide> <c-w><
  142. map <kMultiply> <c-w>>
  143. endif
  144.  
  145. map <F8> :NERDTreeToggle<CR>
  146. map <F7> :TlistToggle<CR>
  147. map <F3> :cs f 3 <C-R><C-W><CR>
  148. map <F2> :cs add cscope.out<CR>
  149. map <F4> :cs f t <C-R><C-W><CR>
  150.  
  151. "Tagbar
  152. map <F6> :TagbarToggle<CR>
  153.  
  154. "std_c plugin
  155. let c_C99=1
  156.  
  157.  
  158. let g:syntastic_c_check_header = 1
  159.  
  160. "----------------------status line----------------------
  161. set laststatus=2
  162. "syntastic
  163. set statusline=
  164. set statusline+=%#warningmsg#
  165. set statusline+=%{SyntasticStatuslineFlag()}
  166. set statusline+=%*
  167. set statusline+=%F%k\ %l\:%c%(\ %y%m%r%h%)
  168. set statusline+=\(%{&enc}\,%{&fileformat}\)
Add Comment
Please, Sign In to add comment