Advertisement
Guest User

.vimrc

a guest
Jun 2nd, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VIM 2.39 KB | None | 0 0
  1. " Description: Optimized for C/C++ development, but useful also for other things.
  2. " Author: Gerhard Gappmeier
  3. "
  4.  
  5. " set UTF-8 encoding
  6. execute pathogen#infect()
  7. set enc=utf-8
  8. set fenc=utf-8
  9. set termencoding=utf-8
  10. " disable vi compatibility (emulation of old bugs)
  11. set nocompatible
  12. " use indentation of previous line
  13. set autoindent
  14. " use intelligent indentation for C
  15. set smartindent
  16. let delimitMate_expand_cr = 1
  17. let g:indentLine_char = '|'
  18. " configure tabwidth and insert spaces instead of tabs
  19. set tabstop=4        " tab width is 4 spaces
  20. set shiftwidth=4     " indent also with 4 spaces
  21. set expandtab        " expand tabs to spaces
  22. " wrap lines at 120 chars. 80 is somewaht antiquated with nowadays displays.
  23. set textwidth=120
  24. " turn syntax highlighting on
  25. set t_Co=256
  26. syntax on
  27. colorscheme wombat256
  28. " turn line numbers on
  29. set number
  30. " highlight matching braces
  31. set showmatch
  32. " intelligent comments
  33. set comments=sl:/*,mb:\ *,elx:\ */
  34.  
  35. " Install OmniCppComplete like described on http://vim.wikia.com/wiki/C++_code_completion
  36. " This offers intelligent C++ completion when typing ‘.’ ‘->’ or <C-o>
  37. " Load standard tag files
  38. set tags+=~/.vim/tags/cpp
  39. set tags+=~/.vim/tags/gl
  40. set tags+=~/.vim/tags/sdl
  41. set tags+=~/.vim/tags/qt4
  42.  
  43. " Install DoxygenToolkit from http://www.vim.org/scripts/script.php?script_id=987
  44. let g:DoxygenToolkit_authorName="John Doe <john@doe.com>"
  45.  
  46. " Enhanced keyboard mappings
  47. "
  48. " in normal mode F2 will save the file
  49. nmap <F2> :w<CR>
  50. " in insert mode F2 will exit insert, save, enters insert again
  51. imap <F2> <ESC>:w<CR>i
  52. " switch between header/source with F4
  53. map <F4> :e %:p:s,.h$,.X123X,:s,.cpp$,.h,:s,.X123X$,.cpp,<CR>
  54. " recreate tags file with F5
  55. map <F5> :!ctags -R –c++-kinds=+p –fields=+iaS –extra=+q .<CR>
  56. " create doxygen comment
  57. map <F6> :Dox<CR>
  58. " build using makeprg with <F7>
  59. map <F7> :make<CR>
  60. " build using makeprg with <S-F7>
  61. map <S-F7> :make clean all<CR>
  62. " goto definition with F12
  63. map <F12> <C-]>
  64. " in diff mode we use the spell check keys for merging
  65. if &diff
  66.   ” diff settings
  67.   map <M-Down> ]c
  68.   map <M-Up> [c
  69.   map <M-Left> do
  70.   map <M-Right> dp
  71.   map <F9> :new<CR>:read !svn diff<CR>:set syntax=diff buftype=nofile<CR>gg
  72. else
  73.   " spell settings
  74.   :setlocal spell spelllang=en
  75.   " set the spellfile - folders must exist
  76.   set spellfile=~/.vim/spellfile.add
  77.   map <M-Down> ]s
  78.   map <M-Up> [s
  79. endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement