Advertisement
Guest User

Untitled

a guest
Feb 9th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. set nocompatible
  2. set mouse=a
  3.  
  4.  
  5. " Pathogen vim manager
  6. execute pathogen#infect()
  7.  
  8. " You complete me
  9. let g:ycm_global_ycm_extra_conf = '.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
  10. let g:ycm_confirm_extra_conf = 0
  11.  
  12. syntax enable " Turn on syntax highlighting
  13. set hidden " Leave hidden buffers open set history=100 "by default Vim saves your last 8 commands. We can handle more
  14.  
  15. " No annoying sound on errors
  16. set noerrorbells
  17. set novisualbell
  18. set t_vb=
  19. set tm=500
  20.  
  21. set magic " For regexes set magic on
  22. " Configure backspace so it acts as it should act
  23. set backspace=eol,start,indent
  24. set whichwrap+=<,>,h,l
  25.  
  26. " Ignore compiled files
  27. set wildignore=*.o,*~,*.pyc
  28. if has("win16") || has("win32")
  29. set wildignore+=.git\*,.hg\*,.svn\*
  30. else
  31. set wildignore+=*/.git/*,*/.hg/*,*/.svn/*,*/.DS_Store
  32. endif
  33.  
  34. set hlsearch
  35.  
  36. " Save on make
  37. set autowrite
  38.  
  39. "COLORS!
  40. colorscheme thayer
  41. highlight Normal ctermfg=grey
  42. set t_Co=256
  43.  
  44. " Rebind keys
  45. nnoremap ; l
  46. noremap <S-Enter> o<Esc>
  47. noremap <silent> <C-S> :update<CR>
  48. vnoremap <silent> <C-S> <C-C>:update<CR>
  49. inoremap <silent> <C-S> <C-O>:update<CR>
  50.  
  51. " Close NERDTree if only window
  52. autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType == "primary") | q | endif
  53.  
  54. " Tabs and spaces!
  55. set tabstop=4
  56. set expandtab
  57. set shiftwidth=4
  58. set smarttab
  59. set autoindent
  60.  
  61. " If coding in C change spaces and tabs
  62. autocmd BufNewFile,BufRead *.c setlocal tabstop=8
  63. autocmd BufNewFile,BufRead *.c setlocal shiftwidth=8
  64.  
  65. autocmd BufNewFile,Bufread FileType make setlocal noexpandtab
  66.  
  67. " Line numbers
  68. set number
  69.  
  70. " Whitespace
  71. function! <SID>StripTrailingWhitespaces()
  72. let l = line(".")
  73. let c = col(".")
  74. %s/\s\+$//e
  75. call cursor(l, c)
  76. endfun
  77.  
  78. autocmd BufWritePre * :call <SID>StripTrailingWhitespaces()
  79.  
  80. " gvim changes
  81. if has("gui_running")
  82. " Allow Ctrl-Shift-V to paste
  83. noremap <C-S-v> "+p
  84. inoremap <C-S-v> "+p
  85. " Allow Ctrl-S to save
  86. noremap <C-s> :w
  87. endif
  88.  
  89. if has("gui_running")
  90. autocmd VimEnter * NERDTree ~/Codes/
  91. autocmd BufWinEnter * NERDTreeMirror
  92. endif
  93.  
  94. " Tab shortcuts
  95. noremap <C-Tab> :tabn<CR>
  96. inoremap <C-Tab> :tabn<CR>
  97. noremap <C-S-Tab> :tabp<CR>
  98. inoremap <C-S-Tab> :tabp<CR>
  99. noremap <C-t> :tabnew<CR>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement