vimrc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. "set right encoding
  2. set encoding=utf-8
  3. set fileencoding=utf-8
  4. "use jk for Escape
  5. inoremap jk <ESC>
  6. "remap mapleader / to , this vim stuff ist really not thaaaat comfortable if
  7. "you are not used to it O.o
  8. let mapleader = ","
  9. "open Nerdtree with CTRL+n
  10. map <C-n> :NERDTreeToggle<CR>
  11. "open Tagbar with CTRL+m
  12. map <C-m> :TagbarToggle<CR>
  13. " trigger snipmate
  14. imap kj <Plug>snipMateNextOrTrigger
  15. "configure for guivim if its active
  16. if has("gui_macvim")
  17. set guifont=Meslo\ LG\ S\ for\ Powerline:h13
  18. endif
  19. "Set auto inline on
  20. set ai
  21. "Show line numbers
  22. set number
  23. "Set syntax highlighting on
  24. syntax on
  25. " Spaces instead of Tabs
  26. " Use 4 Spaces as default and 2 Spaces for cpp files
  27. if expand("%:e")=="cpp"
  28. set tabstop=2
  29. set shiftwidth=2
  30. else
  31. set tabstop=4
  32. set shiftwidth=4
  33. endif
  34. set expandtab
  35. filetype off "Required for vundle
  36. set rtp+=~/.vim/bundle/vundle/
  37. call vundle#rc()
  38. " Let Vundle manage Vundle (required)
  39. Bundle 'gmarik/vundle'
  40. " Own bundles
  41. " Only use YCM if macvim is available. YCM is incompatible with vim version <
  42. " 7.3...
  43. if has("gui_macvim")
  44. Bundle 'Valloric/YouCompleteMe'
  45. endif
  46. Bundle 'klen/python-mode'
  47. Bundle 'majutsushi/tagbar'
  48. Bundle 'scrooloose/nerdtree'
  49. " Define runtime-path (rtp) if there is no explicit repo for vim
  50. Bundle 'chriskempson/tomorrow-theme', {'rtp': 'vim/'}
  51. Bundle 'bling/vim-airline'
  52. " all three following plugins are needed for vim-snipmate
  53. Bundle "MarcWeber/vim-addon-mw-utils"
  54. Bundle "tomtom/tlib_vim"
  55. Bundle "garbas/vim-snipmate"
  56. filetype plugin indent on " required for vundle
  57. "Tomorrow color scheme
  58. colo Tomorrow-Night-Bright
  59. if has("gui_macvim")
  60. set transparency=10
  61. endif
  62. " Close tip-window when selection is done or leaving insert mode
  63. autocmd CursorMovedI * if pumvisible() == 0|pclose|endif
  64. autocmd InsertLeave * if pumvisible() == 0|pclose|endif
  65. " YCM Configuration
  66. " dont use python-mode autocomplete obsolete now, because of YCM
  67. let g:pymode_rope = 0
  68. " only use ycm for python code
  69. let g:ycm_filetype_whitelist = {'python': 1, 'cpp': 1}
  70. " set ycm_extra_conf
  71. let g:ycm_global_ycm_extra_conf = '~/.ycm_extra_conf.py'
  72. " turn off the ycm diagnostic because of struggling with root
  73. let g:ycm_show_diagnostics_ui = 0
  74. " NERDTree Configuration
  75. " hide some fileextenxions
  76. let NERDTreeIgnore = ['\.pyc$']
  77. " Airline stuff
  78. set laststatus=2
  79. let g:airline_powerline_fonts = 1
  80. let g:airline#extensions#tabline#enabled = 1
  81. let g:airline#extensions#tabline#buffer_nr_show = 1
  82. " allways show tagbar
  83. "autocmd VimEnter * nested :call tagbar#autoopen(1)
  84. "let g:tagbar_autoclose = 0
  85. " activate mouse support
  86. set mouse=a