summaryrefslogtreecommitdiff
path: root/d/tools/vim/plugin/robot.vim
diff options
context:
space:
mode:
Diffstat (limited to 'd/tools/vim/plugin/robot.vim')
-rw-r--r--d/tools/vim/plugin/robot.vim72
1 files changed, 72 insertions, 0 deletions
diff --git a/d/tools/vim/plugin/robot.vim b/d/tools/vim/plugin/robot.vim
new file mode 100644
index 0000000..7b2d324
--- /dev/null
+++ b/d/tools/vim/plugin/robot.vim
@@ -0,0 +1,72 @@
+" Name: robot
+" Author: Nicolas Schodet <schodet@efrei.fr>
+" Last Update: 2005-07-23
+" Description: Paramètre vim pour Efrei Robotique.
+" License: Domaine public.
+" Installation: Mettre le script dans &runtimepath/plugin.
+
+if exists('g:robot_plugin') | finish | endif
+let g:robot_plugin = 1
+
+" Paramètres pour le robot.
+function! Robot()
+ " Comportement un peu plus cool
+ set nocompatible
+ set backspace=2
+ " Formattage
+ set autoindent
+ set textwidth=78
+ set formatoptions=tcqnl
+ set nocindent
+ set smartindent
+ set smarttab
+ set nojoinspaces
+ " Quickfix
+ set errorformat=
+ \%*[^\"]\"%f\"%*\\D%l:\ %m,
+ \\"%f\"%*\\D%l:\ %m,
+ \%-G%f:%l:\ error:\ (Each\ undeclared\ identifier%.%#,
+ \%-G%f:%l:\ error:\ for\ each\ function\ it\ appears\ in.),
+ \%f:%l:%m,
+ \\"%f\"\\,
+ \\ line\ %l%*\\D%c%*[^\ ]\ %m,
+ \%D%*\\a:\ Entering\ directory\ `%f',
+ \%X%*\\a:\ Leaving\ directory\ `%f',
+ \%DMaking\ %*\\a\ in\ %f
+ " Les .h c'est du C
+ let g:c_syntax_for_h = 1
+ " Options de formatage
+ set cinoptions={.5s:.5sg.5sh.5st0(0=.5s
+ " Syntax highlighting et types de fichiers
+ filetype plugin indent on
+ syn on
+ " Plugins
+ let g:template_variant = "robot"
+ let g:ghph_GrabComments = 1
+ let g:ghph_Reformat = 1
+ let g:ghph_PutAfter = 1
+ let g:ghph_SplitReturn = 1
+endfunction
+
+function! RobotProg()
+ " Options de programation
+ setlocal formatoptions+=rt
+ setlocal shortmess-=T
+ setlocal shiftwidth=4
+ setlocal cindent
+ setlocal fo-=o fo-=r
+ setlocal com-=:// com+=:///,://
+ " Appelle GHPH
+ nmap <buffer> <Leader>g :GHPH g<CR>
+ nmap <buffer> <Leader>h :GHPH p<CR>
+endfunction
+
+" Permet de désactiver l'execution automatique.
+if exists('g:no_robot') | finish | endif
+
+call Robot()
+
+au FileType c call RobotProg()
+au FileType cpp call RobotProg()
+au BufNewFile README Template README
+au BufNewFile *.c,*.cc,*.tcc,*.icc,*.h,*.hh,*.hpp,*.C,*.cxx TemplateHeader