vimrc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. " Uset compatibility with Vii
  2. set nocompatible
  3. " add user info variable
  4. let g:_author = "Bastien Chanot"
  5. let g:_email = "chanot.bastien@gmail.com"
  6. " Enable pathogen for plugins
  7. execute pathogen#infect()
  8. " Set colors options
  9. syntax on
  10. set t_Co=256
  11. colorscheme molokai
  12. " Set line numbers
  13. set number
  14. " Activate mouse click
  15. set mouse=a
  16. " Set some indent options
  17. set smartindent
  18. set autoindent
  19. filetype plugin indent on
  20. " make backspace work on all system
  21. set backspace=indent,eol,start
  22. " Set the encoding
  23. set encoding=utf-8
  24. " Activate cursor go on line at end/begin of line
  25. set whichwrap+=<,>,h,l,[,]
  26. " Set number of spacetab and the char to print
  27. let tab_placeholder='»·'
  28. let space_placeholder='·'
  29. execute "set list listchars=tab:". tab_placeholder .",trail:". space_placeholder
  30. set tabstop=4
  31. set shiftwidth=4
  32. set softtabstop=4
  33. " Activate sor syntastic options
  34. let g:syntastic_c_compiler = 'gcc'
  35. let g:syntastic_c_compiler_options = '-Wall -Werror -Wextra'
  36. let g:syntastic_check_on_open=1
  37. let g:syntastic_enable_signs=1
  38. let g:syntastic_c_remove_include_errors = 1
  39. let g:syntastic_c_include_dirs = ['../../../include', '../../include','../include','./include','../../../includes', '../../includes','../includes','./includes','../../../inc', '../../inc','../inc','./inc']
  40. " Open NERDTree with Ctrl + g
  41. noremap <C-g> :NERDTreeToggle<CR>
  42. noremap <C-e> :!
  43. noremap <C-t> :tabedit
  44. noremap <TAB> :tabnext<CR>
  45. noremap <BACKSPACE> :tabprev<CR>
  46. noremap <C-+> :vertical resize +1<CR>
  47. noremap <C--> :vertical resize -1<CR>
  48. " Fonction pour générer une classe avec règle canonique
  49. function! GenerateClassH(name)
  50. execute "normal oclass " . a:name . " {"
  51. execute "normal opublic:"
  52. execute "normal o" . a:name . "();"
  53. execute "normal o" . a:name . "(" . a:name . " const &src);"
  54. execute "normal o~" . a:name . "();"
  55. execute "normal o"
  56. execute "normal o" . a:name . "\t&operator=(" . a:name . " const &src);"
  57. execute "normal o"
  58. execute "normal oprivate:"
  59. execute "normal o"
  60. execute "normal o};"
  61. endfunction
  62. " Commande :Class Test1
  63. command! -nargs=1 ClassH call GenerateClassH(<f-args>)
  64. " Fonction pour générer une classe avec règle canonique
  65. function! GenerateClassC(name)
  66. execute "normal o" . name . "::" . name . "(void) {"
  67. execute "normal o std::cout << \"Default constructor called\" << std::endl;"
  68. execute "normal o return ;"
  69. execute "normal o}"
  70. execute "normal o"
  71. execute "normal o" . name . "::" . name . "(" . name . " const &src) {"
  72. execute "normal o *this = src;"
  73. execute "normal o std::cout << \"Copy constructor called\" << std::endl;"
  74. execute "normal o return ;"
  75. execute "normal o}"
  76. execute "normal o"
  77. execute "normal o" . name . "::~" . name . "(void) {"
  78. execute "normal o std::cout << \"Default destructor called\" << std::endl;"
  79. execute "normal o return ;"
  80. execute "normal o}"
  81. execute "normal o"
  82. execute "normal o" . name . " &" . name . "::operator=(" . name . " const &src) {"
  83. execute "normal o std::cout << \"Copy assignment operator called\" << std::endl;"
  84. execute "normal o return *this;"
  85. execute "normal o}"
  86. endfunction
  87. " Commande :Class Test1
  88. command! -nargs=1 ClassC call GenerateClassC(<f-args>)