summaryrefslogtreecommitdiff
path: root/d/tools
diff options
context:
space:
mode:
authorschodet2005-07-23 12:12:49 +0000
committerschodet2005-07-23 12:12:49 +0000
commitc3550a079957aa01633ed32632a5229ae4edb4c3 (patch)
tree011d76ce67a5585f6ba65fe6edbc7305c715212c /d/tools
parent3742cbc92d0203080a57b93ca56cf6dc116e818f (diff)
Ajout de fichiers pour vim.
Diffstat (limited to 'd/tools')
-rw-r--r--d/tools/doc/info.txt5
-rw-r--r--d/tools/vim/README12
-rw-r--r--d/tools/vim/ftplugin/cpp/copycppdectoimp.vim787
-rw-r--r--d/tools/vim/ftplugin/help.vim17
-rw-r--r--d/tools/vim/plugin/robot.vim72
-rw-r--r--d/tools/vim/plugin/template.vim127
-rw-r--r--d/tools/vim/plugin/utils.vim26
-rw-r--r--d/tools/vim/syntax/aft.vim201
-rw-r--r--d/tools/vim/templates/robot.README24
-rw-r--r--d/tools/vim/templates/robot.c29
-rw-r--r--d/tools/vim/templates/robot.cpp26
-rw-r--r--d/tools/vim/templates/robot.h31
-rw-r--r--d/tools/vim/templates/robot.hpp28
13 files changed, 1385 insertions, 0 deletions
diff --git a/d/tools/doc/info.txt b/d/tools/doc/info.txt
index c910251..d562963 100644
--- a/d/tools/doc/info.txt
+++ b/d/tools/doc/info.txt
@@ -44,6 +44,11 @@ Pour vim et pour coder, quelques commandes :
Y'en a plein d'autre mais si vous utilisez vim, elles viendront vite.
+*** Plugin Efrei Robotique
+
+Allez faire un tour dans |d/tools/vim| pour avoir une config toute faite pour
+Efrei Robotique.
+
* Compilateurs
** Pour le C
diff --git a/d/tools/vim/README b/d/tools/vim/README
new file mode 100644
index 0000000..ed4dbfa
--- /dev/null
+++ b/d/tools/vim/README
@@ -0,0 +1,12 @@
+Pour utiliser ces fichiers, copier le tout dans votre répertoire .vim dans
+votre répertoire home :
+
+ mkdir ~/.vim
+ cp -r * ~/.vim
+
+Et ajouter dans votre .vimrc :
+
+let g:fullname = "Henri Dugenou"
+let g:copyright = g:fullname
+let g:email = "dugenou@efrei.fr"
+let g:nickname = "Dug"
diff --git a/d/tools/vim/ftplugin/cpp/copycppdectoimp.vim b/d/tools/vim/ftplugin/cpp/copycppdectoimp.vim
new file mode 100644
index 0000000..4d86dbc
--- /dev/null
+++ b/d/tools/vim/ftplugin/cpp/copycppdectoimp.vim
@@ -0,0 +1,787 @@
+" vim:ff=unix ts=4 ss=4 sw=4
+" vim60:fdm=marker
+" \file copycppdectoimp.vim
+" \date Tue, 03 Jun 2003 02:21 Pacific Daylight Time
+"
+" \brief This provides a function that you can call in your header file
+" (with cursor on the function to be placed into your souce file) and
+" then called from your source file where you want the function
+" definition to be placed and the function makes it all pretty and
+" does most of the work for you. Pretty handy.
+" \note This is VIMSCRIPT#437,
+" http://vim.sourceforge.net/script.php?script_id=437
+"
+" \note From VIM-Tip #335: Copy C++ function declaration into
+" implementation file by Leif Wickland
+" See: http://vim.sourceforge.net/tip_view.php?tip_id=335
+" \note For a similar idea see Luc Hermitte's VIMSCRIPT#336,
+" (cpp_InsertAccessors.vim in particular)
+" http://vim.sourceforge.net/scripts/script.php?script_id=336
+" http://hermitte.free.fr/vim/
+"
+" \author Robert KellyIV <Sreny@SverGbc.Pbz> (Rot13ed)
+" \author Original idea/implimentaion: Leif Wickland
+" \note Emial addresses are Rot13ed. Place cursor in the <> and do a g?i<
+" \note This file and work is based on Leif Wickland's VIM-TIP#335
+" \version $Id: copycppdectoimp.vim,v 1.3 2002/10/29 06:14:16 root Exp $
+" Version: 0.46
+" History: {{{
+" [Feral:154/03@02:12] 0.46
+" Refined matching declaration prens; should be more resistant to
+" mismatched prens outside of the function declaration. Mismatched prens
+" inside the function declaration (i.e. in comments) will confuse this
+" still.
+" [Feral:124/03@02:13] 0.45
+" Bug fix: more robust handling of comments and prens and things in
+" multi line function declorations.
+" [Feral:095/03@00:33] 0.44
+" * Small fix to take into account non blank equalprg; thanks to Nathan
+" Dunn for help tracking this down.
+" [Feral:290/02@06:15] 0.43
+" * Bugfix, The case of filename extension no loger matters during the
+" check for header/source.
+" [Feral:288/02@08:49] 0.42
+" namespaces and destructors now are handled properly.
+" Improvments:
+" * properly handles namespaces, thanks to Russell for pointing this
+" out.
+" * Proprly handles class destructors, Thanks to Andy for pointing this
+" out.
+" [Feral:287/02@00:32] 0.41
+" Drat.
+" Improvments:
+" * Fixed a fold marker bungle (had a mismated closing foldmarker at the
+" end of this comment block. erm, oops.)
+" * Bugfix: Using setlocal now. (as a ftplugin should)
+" * More Cleanup.
+" * Can be invoked in the middle of a multi line function decloration
+" now, much better.
+" * Now uses global vars to decide what commands to define, defaulting
+" to :GHPH. See ||@|GHPH Options| below
+" Limitations:
+" * (recap) A inlined function with no (); construct will not be
+" recognised as a function.
+" [Feral:286/02@16:58] 0.4
+" Thanks to Andy for pointing out that inlined functions caused this to
+" fail.
+" Improvments:
+" * Changed method to find the class, now works with inlined functions.
+" * Added :GH and :PH remed, unrem if you want to use them.
+" * General Script Cleanup (I hope!)
+" * Replaced function params with global vars for options; allows
+" onthefly option changing.
+""
+" (I hope you consider it an improvement anyway (: if you do not you
+" can basicaly ignore this fancy smacy global var stuff by unremming
+" the :lets at the command definition below and then forgetting them
+" :) )
+" Limitations:
+" * A inlined function with no (); construct will not be recognised as a
+" function.
+" * (recap) Must be invoked on the line that starts the the function
+" decloration. -- I'll probably get around to doing something with
+" this limitation eventually.
+" [Feral:283/02@16:42] 0.33
+" Thanks again goto Rostislav for ideas and suggestions
+" Improvments:
+" * Proper FTPlugin now, at least I think.
+" * struct and nested structs workie now too.
+" * can specify an override param and have :GHPH paste or get
+" regardless of the file type it's in. i.e. :GHPH p or :GHPH g
+" * added .hpp, .hh, .hxx as recognizable header files.
+" [Feral:282/02@17:03] 0.32
+" Rather large change to support nested classes. Ok not THAT large.
+" Thanks to Rostislav for pointing this out.
+" Using searchpair to find the class inspired by Luc Hermitte.
+" Improvments:
+" * More intelligent/robust checking/finding the class.
+" * Nested classes are now supported.
+" * Normal functions now work.
+" [Feral:281/02@16:24] 0.31
+" as Rostislav Julinek pointed out [[ does not work when the brace is not
+" in col 1. If you like your braces after your class definition this
+" should do the trick for you.
+" [Feral:278/02@00:29] 0.3
+" Improvments:
+" * fairly drastic improvement. Now works with multi-line function
+" declarations as long as they are properly closed(open prens will
+" make this fail), aka if it compiles it should work.
+" Limitation:
+" * Must be invoked on the line that starts the the function decloration.
+" [Feral:275/02@14:50] 0.21
+" * Itty bitty file format changes, email address is Rot13ed now,
+" documtation and command defintions are folded.
+" * Slight improvement(?) in fetching the line, in a script so why not
+" getline(".") eh?
+" [Feral:274/02@20:42] 0.2
+" Improvments: from Leif's Tip (#335):
+" * can handle any number of default prams (as long as they are all on
+" the same line!)
+" * Options on how to format default params, virtual and static. (see
+" below) TextLink:||@|Prototype:|
+" * placed commands into a function (at least I think it's an improvement
+" ;) )
+" * Improved clarity of the code, at least I hope.
+" * Preserves registers/marks. (rather does not use marks), Should not
+" dirty anything.
+" * All normal operations do not use mappings i.e. :normal!
+" (I have Y mapped to y$ so Leif's mappings could fail for me.)
+"
+" Limitations:
+" * fails on multi line declorations. All prams must be on the same line.
+" * fails for non member functions. (though not horibly, just have to
+" remove the IncorectClass:: text...
+" 0.1
+" Leif's original VIM-Tip #335
+" }}}
+" Ideas Thoughts And Possible Expansions: {{{ Feedback requested.
+" Should This Also Manage Data Members:? {{{2
+" (basicaly mearge what I did with getset.vim into this.)
+" Advantages:
+" * No need to remember another command (of course one could easily make
+" a stub that calls this or getset (for instance) based on the
+" contents of the lne.
+"
+" Or stub this to call getset if the line does not register as a
+" function decloration, which is probably what I'll end up doing
+" if no one cares... [Feral:286/02@17:53]
+" Disadvantages:
+" * Would clutter up the code and if you already have a getset type
+" thing (Luc has a very nice one) it's pointless wasted space.
+" (Unless it is just I just call another func when I think it's a
+" member var.)
+"
+" Handel Template Functions: {{{2
+" Ideas from Rostislav and Luc
+" What do these things look like anyway? -- I have not messed with
+" templates enough to know the ins and outs of them, examples wanted!
+"
+" End: {{{2
+" }}}2
+" }}}
+
+"Place something like the below in your .vimrc or whereever you like to keep
+" your global option vars and change as desired.
+""
+""*****************************************************************
+"" GHPH Options: {{{
+""*****************************************************************
+"" See copycppdectoimp.vim for more documtation.
+"" Virtual: 1 for commented, else removed.
+"let g:ghph_ShowVirtual = 0
+"" Static: 1 for commented, else removed.
+"let g:ghph_ShowStatic = 0
+"" Default Params: 3 for /*5*/, 2 for /* = 5*/, else removed.
+"let g:ghph_ShowDefaultParams = 3
+"" Grab Comments: 1 to grab, 0 to NOT grab.
+"let g:ghph_GrabComments = 1
+"" Reformat: 1 to reformat, 0 to NOT reformat.
+"let g:ghph_Reformat = 0
+"" Paste After: 1 to paste after, 0 to paste before.
+"let g:ghph_PutAfter = 0
+"" Split Return: 1 to split line between return value and function name.
+"let g:ghph_SplitReturn = 0
+"" Command: 1 to define :GHPH (default if nothing defined), 0 to NOT define.
+"let g:ghph_useGHPH = 1
+"" Command: 1 to define :GH and :PH, 0 to NOT define.
+"let g:ghph_useGHandPH = 1
+"" }}}
+""
+
+if exists("b:loaded_copycppdectoimp")
+ finish
+endif
+let b:loaded_copycppdectoimp = 1
+
+
+"*****************************************************************
+" Functions: {{{
+
+if !exists("*s:GrabFromHeaderPasteInSource(...)")
+function s:GrabFromHeaderPasteInSource(...) "{{{
+ let l:WhatToDo = 0 " 0 = get header, else put header.
+ " [Feral:283/02@15:40] sort of guessing on extesions here.. I tend to only
+ " use .h ...
+ " [Feral:123/03@23:59] Could \<h perhaps. (i.e. if ext starts with h
+ " consider it a header.)
+ if match(expand("%:e"), '\c\<h\>\|\<hpp\>\|\<hh\>\|\<hxx\>') > -1
+ let l:WhatToDo = 0
+ else
+ let l:WhatToDo = 1
+ endif
+
+ " Just for clarity override the above as a separate if
+ if a:0 == 1
+ if a:1 == '0' || a:1 ==? "h" || a:1 ==? "g"
+ let l:WhatToDo = 0
+ elseif a:1 == '1' || a:1 ==? "c" || a:1 ==? "p"
+ let l:WhatToDo = 1
+ else
+ echo "GHPH: ERROR: Unknown option"
+ return
+ endif
+ endif
+" echo confirm("l:WhatToDo:".l:WhatToDo)
+
+
+
+ " handle options
+" if exists("g:cpp_ShowVirtual")
+" let howtoshowVirtual = g:cpp_ShowVirtual
+" else
+ if exists('g:ghph_ShowVirtual')
+ let howtoshowVirtual = g:ghph_ShowVirtual
+ else
+ let howtoshowVirtual = 0
+ endif
+
+" if exists("g:cpp_ShowStatic")
+" let howtoshowStatic = g:cpp_ShowStatic
+" else
+ if exists('g:ghph_ShowStatic')
+ let howtoshowStatic = g:ghph_ShowStatic
+ else
+ let howtoshowStatic = 0
+ endif
+
+" if exists("g:cpp_ShowDefaultParams")
+" let howtoshowDefaultParams = g:cpp_ShowDefaultParams
+" else
+ if exists('g:ghph_ShowDefaultParams')
+ let howtoshowDefaultParams = g:ghph_ShowDefaultParams
+ else
+ let howtoshowDefaultParams = 3
+ endif
+
+" if exists("g:cpp_GrabComments")
+" let howtograbComments = g:cpp_GrabComments
+" else
+ if exists('g:ghph_GrabComments')
+ let howtograbComments = g:ghph_GrabComments
+ else
+ let howtograbComments = 1
+ endif
+
+" if exists("g:cpp_Reformat")
+" let howtoreformat = g:cpp_Reformat
+" else
+ if exists('g:ghph_Reformat')
+ let howtoreformat = g:ghph_Reformat
+ else
+ let howtoreformat = 0
+ endif
+
+" if exists("g:cpp_PutAfter")
+" let putAfter = g:cpp_PutAfter
+" else
+ if exists('g:ghph_PutAfter')
+ let putAfter = g:ghph_PutAfter
+ else
+ let putAfter = 0
+ endif
+
+" if exists("g:cpp_SplitReturn")
+" let splitReturn = g:cpp_SplitReturn
+" else
+ if exists('g:ghph_SplitReturn')
+ let splitReturn = g:ghph_SplitReturn
+ else
+ let splitReturn = 0
+ endif
+
+
+
+ " Now do something!
+ if l:WhatToDo == 0
+ " {{{ GET the header
+ " save our position
+ let SaveL = line(".")
+ let SaveC = virtcol(".")
+ " :help restore-position
+ execute ":normal! H"
+ let SaveT = line('.')
+ execute ":normal! ".SaveL."G"
+
+
+
+ " [Feral:287/02@00:58] Rearangement and now works when cursor is in
+ " the middle of a multi line decloration.
+ " [Feral:277/02@12:54] In an attempt to grab the entire multi line
+ " function decloration (I often have a param per line with comments)
+ " do a searchpair to find the last pren.
+" let StartLine = line('.')
+ " if there is a ( in the line, goto it in prep for our searchpair.
+ if stridx(getline('.'), '(') > -1
+ execute "normal! 0f("
+ endif
+ " Important that End comes first, this gets us into the ()...
+ " [Feral:154/03@02:02] Find the outermost () pair but ensure that the
+ " closing pren is followed by a ; on the same line.
+ let EndLine = searchpair('(','',').\{-};', 'rW')
+
+" echo confirm("This is end ".EndLine."\n".getline(EndLine))
+
+ " goto the start of the pren, this should be the line with the function decloration
+" let StartLine = searchpair('(','',').\{-};', 'b')
+" let StartLine = searchpair('(','',')', 'br')
+ " [Feral:154/03@01:56] searchpair to find end; already found the outer
+ " match, just find it's pair now.
+ let StartLine = searchpair('(','',')', 'bW')
+
+
+" echo confirm("This is start ".StartLine."\n".getline(StartLine))
+
+ if EndLine == 0 || StartLine == 0
+ echo "GHPH: ERROR: Sorry this does not look like a function decloration, missing '(' and or ')' with trailing ';'"
+ return
+ endif
+
+ let s:CommentLines = 0
+ if howtograbComments == 1
+ " Grab comment above function declaration
+ while match (getline (StartLine - 1), '\s*\/\/') != -1
+ let StartLine = StartLine - 1
+ let s:CommentLines = s:CommentLines + 1
+ endwhile
+ endif
+
+ :let Was_Reg_l = @l
+ ":[range]y[ank] [x] Yank [range] lines [into register x].
+ execute ":".StartLine.",".EndLine."yank l"
+ :let s:LineWithDecloration = @l
+ :let @l=Was_Reg_l
+" echo confirm(s:LineWithDecloration)
+
+"[Feral:093/03@16:49] In dev, probaly should be some informative message if s:LineWithDecloration is bad. (define bad)
+" if s:LineWithDecloration == ""
+" echo "GHPH: ERROR: Unable to find"
+" endif
+ let s:LineWithDeclorationSize = ( (EndLine - StartLine) + 1) - s:CommentLines
+" echo confirm(s:LineWithDeclorationSize)
+
+" "[Feral:282/02@17:03] Rather large change to support nested classes
+" " and as a side benefit normal functions now work.
+" {{{ Mark I -- Old code
+" let s:ClassName = ""
+" let mx='\<class\>\s\{-}\(\<\I\i*\)\s\{-}.*'
+" while searchpair('\<class\>.\{-}\n\=\s\{-}{','','}', 'bW') > 0
+" let DaLine = getline('.')
+" let Lummox = matchstr(DaLine, mx)
+" let s:ClassName = substitute(Lummox, mx, '\1', '') . '::' . s:ClassName
+"" echo confirm(s:ClassName)
+" endwhile
+" }}}
+ "[Feral:283/02@16:29] Good idea Rostislav, lets support structs too!
+" {{{ Mark II -- Old code
+" let s:ClassName = ""
+" let mx='\%(\<class\>\|\<struct\>\)\s\{-}\(\<\I\i*\)\s\{-}.*'
+" while searchpair('\%(\<class\>\|\<struct\>\).\{-}\n\=\s\{-}{','','}', 'bW') > 0
+" let DaLine = getline('.')
+" let Lummox = matchstr(DaLine, mx)
+" let s:ClassName = substitute(Lummox, mx, '\1', '') . '::' . s:ClassName
+"" echo confirm(s:ClassName)
+" endwhile
+"" echo confirm('s:ClassName('.s:ClassName.')')
+" }}}
+ "[Feral:285/02@23:28] Andy found this to not work.
+ "Current Version: Mark III
+" {{{ Mark III
+"class testing
+"{
+"public:
+" virtual void hithere(int x = 4);
+" int dootdedoo(bool x, bool y, bool z) { printf("doot de doo...\n"); }
+" virtual void hithere2(int x = 5);
+"}
+"[Feral:286/02@06:08] Probably have to be a two part search. one {} searchpair
+"so inline function defs are skiped and then a search to find the
+"class/struct.. if we no find pair, we done. If we no find class, we done.
+":echo searchpair('{','','}', 'bW')
+":echo search('\%(\<class\>\|\<struct\>\).\{-}\n\=\s\{-}{', 'bW')
+"[Feral:286/02@06:16] Yes, this seems to work. Tired now, double check later.
+"[Feral:286/02@16:43] Workie fine, or so it seems.
+"[Feral:288/02@08:07] Russell mentions that namespaces do not work, lets fix that.
+"namespace myNamespace {
+" class someClass {
+" public:
+" int doSomething( int i );
+" };
+"}
+ let s:ClassName = ""
+ let mx='\(\<class\>\|\<struct\>\|\<namespace\>\)\s\{-}\(\<\I\i*\)\s\{-}.*'
+ while 1
+ if searchpair('{','','}', 'bW') > 0
+ if search('\%(\<class\>\|\<struct\>\|\<namespace\>\).\{-}\n\=\s\{-}{', 'bW') > 0
+ let DaLine = getline('.')
+ let Lummox = matchstr(DaLine, mx)
+" let s:ClassName = substitute(Lummox, mx, '\1', '') . '::' . s:ClassName
+ let FoundType = substitute(Lummox, mx, '\1', '')
+ let FoundClassName = substitute(Lummox, mx, '\2', '')
+" echo confirm(FoundClassName.' is a '.FoundType)
+ if FoundType !=? 'namespace' && FoundType != ''
+ let s:ClassName = FoundClassName.'::'.s:ClassName
+ endif
+ else
+ echo confirm("copycppdectoimp.vim:DEV:Found {} but no class/struct\nIf this was a proper function and you think it should have worked, email me the (member) function/class setup and I'll see if I can get it to work.(email is in this file)")
+ endif
+ else
+ break
+ endif
+ endwhile
+" echo confirm('s:ClassName('.s:ClassName.')')
+" }}}
+
+
+ " go back to our saved position.
+ :execute ":normal! ".SaveT."Gzt"
+ :execute ":normal! ".SaveL."G"
+ :execute ":normal! ".SaveC."|"
+
+" echo confirm(s:ClassName)
+ " }}}
+ else
+ " {{{PUT the header
+
+ " -[Feral:283/02@16:06]-----------------------------------------------
+ " Gate
+ " [Feral:283/02@16:07] Gate
+ if !exists("s:LineWithDecloration")
+ echo "GHPH: ERROR: I do not have an implimentation to work with!"
+ return
+ endif
+
+" echo confirm(s:ClassName)
+ let SaveL = line(".")
+" let SaveC = virtcol(".")
+ " :help restore-position
+ execute ":normal! H"
+ let SaveT = line('.')
+ execute ":normal! ".SaveL."G"
+" :execute ':normal! ma'
+ :let Was_Reg_n = @n
+ :let @n=@/
+
+
+ " [Feral:277/02@23:02] Multi-line version.
+ :let Was_Reg_l = @l
+ :let @l = s:LineWithDecloration
+" echo confirm(@l)
+ if putAfter == 1
+ execute 'normal! "lp'
+ let SaveL = SaveL + 1
+ else
+ execute 'normal! "lP'
+ endif
+ :let @l=Was_Reg_l
+" echo confirm(line('.'))
+" echo confirm(s:LineWithDeclorationSize)
+
+ " Remove end of line comments for multi line...
+" echo confirm(line('.'))
+ let SaveReport = &report
+ setlocal report=9999
+ let Save2L = line(".") + s:CommentLines
+ execute ':'.Save2L.','.(Save2L+s:LineWithDeclorationSize-1).'s/\s\{-}\/[/*].\{-}$//e'
+ :execute ":normal! ".Save2L."G"
+" echo confirm(line('.'))
+" let &report=SaveReport
+ execute "setlocal report=".SaveReport
+
+ " join multi line into one line
+ if s:LineWithDeclorationSize > 1
+" echo confirm('Jing '.s:LineWithDeclorationSize.' times...')
+ :execute ':normal! '.s:LineWithDeclorationSize.'J'
+" :execute ':join '.s:LineWithDeclorationSize
+" :execute ':'.Save2L.','.(Save2L+s:LineWithDeclorationSize-1).'join '
+
+ " [Feral:278/02@00:17] Get rid of tabs and replace with a single space
+ execute ':s/\t\+/ /ge'
+ " [Feral:278/02@00:18] Fix up that initial FuncName( param_type param, pt2 param2)
+ " I do not like the space between the Function Name the pren and the param. (caused by J)
+ execute ':s/\(\i(\) /\1/e'
+ endif
+
+ " [Feral:095/03@00:07] Small fix for when equalprg is defined, oopsie!
+ " Thanks to Nathan Dunn for help tracking this down.
+ let Was_EqualPrg = &equalprg
+ " seems == does not use a local equalprg, dern.
+ set equalprg=""
+ execute ':'.SaveL.','.(SaveL+s:CommentLines).'normal! =='
+ execute "set equalprg=".Was_EqualPrg
+
+ " XXX if you want virtual commented in the implimentation:
+ if howtoshowVirtual == 1
+ execute ':s/\<virtual\>/\/\*&\*\//e'
+ else
+ " XXX else, remove virtual and any spaces/tabs after it.
+ execute ':s/\<virtual\>\s*//e'
+ endif
+
+ " XXX if you want static commented in the implimentation:
+ if howtoshowStatic == 1
+ execute ':s/\<static\>/\/\*&\*\//e'
+ else
+ " XXX else, remove static and any spaces/tabs after it.
+ execute ':s/\<static\>\s*//e'
+ endif
+
+ " wipe out a pure virtual thingie-ma-bob. (technical term? (= )
+ execute ':s/)\s\{-}=\s\{-}0\s\{-};/);/e'
+
+ " Handle default params, if any.
+ if howtoshowDefaultParams == 1
+ " Remove the default param assignments.
+ execute ':s/\s\{-}=\s\{-}[^,)]\{1,}//ge'
+ else
+ " Comment the default param assignments.
+ execute ':s/\s\{-}\(=\s\{-}[^,)]\{1,}\)/\/\*\1\*\//ge'
+
+ if howtoshowDefaultParams == 3
+ " Remove the = and any spaces to the left or right.
+ execute ':s/\s*=\s*//ge'
+ endif
+ endif
+
+ let @/=@n
+ let @n=Was_Reg_n
+ "execute ":normal! ".SaveT."Gzt"
+ "execute ":normal! ".SaveL."G"
+"[Feral:288/02@08:29] Andy mentions destructors are well, broken. Duh how
+"could I forget destructors anyway?
+" if s:ClassName !=# ""
+" if stridx(getline('.'), '~') > -1
+" execute ':normal! 0f(F~'
+" else
+" execute ':normal! 0f(b'
+" endif
+" execute ':normal! i'.s:ClassName
+" endif
+ " The previous code do not work with operator<< like functions.
+ if s:ClassName !=# ""
+ if splitReturn == 0
+ execute ':s/~\?\w\+\W*(/'.s:ClassName.'&/'
+ else
+ if match (getline ('.'), '^\~\?\w\+\W*(') == -1
+ execute ':s/\s*\(\~\?\w\+\W*(\)/'."\r".s:ClassName.'\1/'
+ else
+ execute ':s/\s*\(\~\?\w\+\W*(\)/'.s:ClassName.'\1/'
+ endif
+ endif
+ endif
+" :execute ":normal! ".SaveC."|"
+
+ " Reformat line:
+ if howtoreformat == 1
+ let Was_FormatPrg = &formatprg
+ set formatprg=""
+ execute ':normal! gqq'
+ execute "set formatprg=".Was_FormatPrg
+ endif
+
+ " find the ending ; and replace it with a brace structure on the next line.
+ if putAfter
+ execute ":normal! f;s\<cr>{\<cr>}\<cr>\<esc>2k"
+ else
+ execute ":normal! f;s\<cr>{\<cr>}\<esc>k"
+ endif
+ " }}}
+ endif
+
+endfunc " }}}
+endif
+
+" }}} EO Functions
+"*****************************************************************
+" Documtation: {{{
+"*****************************************************************
+" Script Function Prototype:
+"GrabFromHeaderPasteInSource(VirtualFlag, StaticFlag, DefaultParamsFlag)
+"
+" Given:
+" virtual void Test_Member_Function_B3(int _iSomeNum2 = 5, char * _cpStr = "Yea buddy!");
+"
+" VirtualFlag:
+" let g:ghph_ShowVirtual = 1
+" If you want virtual commented in the implimentation:
+" IE: /*virtual*/ void Test_Member_Function_B3(int _iSomeNum2 = 5, char * _cpStr = "Yea buddy!");
+" let g:ghph_ShowVirtual = 0
+" If you want virtual and any spaces/tabs after it removed.
+" IE: void Test_Member_Function_B3(int _iSomeNum2 = 5, char * _cpStr = "Yea buddy!");
+"
+" StaticFlag:
+" let g:ghph_ShowStatic = 1
+" If you want static commented in the implimentation:
+" IE: Same as virtual, save deal with static
+" let g:ghph_ShowStatic = 0
+" If you want static and any spaces/tabs after it removed.
+" IE: Same as virtual, save deal with static
+"
+" DefaultParamsFlag:
+" Note: darn bungled I see, no entry for 0 ... OOPS (:
+" let g:ghph_ShowDefaultParams = 1
+" If you want to remove default param reminders
+" IE: Test_Member_Function_B3(int _iSomeNum2, char * _cpStr);
+" let g:ghph_ShowDefaultParams = 2
+" If you want to comment default param assignments
+" IE: Test_Member_Function_B3(int _iSomeNum2/*= 5*/, char * _cpStr/*= "Yea buddy!"*/);
+" let g:ghph_ShowDefaultParams = 3
+" Like 2 but, If you do not want the = in the comment
+" IE: Test_Member_Function_B3(int _iSomeNum2/*5*/, char * _cpStr/*"Yea buddy!"*/);
+"
+" GrabCommentsFlag:
+" let g:ghph_GrabComments = 1
+" If you want to grab comments above your function declaration.
+" let g:ghph_GrabComments = 0
+" If you want to discard any comments.
+"
+" ReformatFlag:
+" let g:ghph_Reformat = 1
+" If you do not like long line in your function implementation.
+" IE: Test_Member_Function_B3(int _iSomeNum2/*= 5*/,
+" char * _cpStr/*= "Yea buddy!"*/)
+" let g:ghph_Reformat = 0
+" If you do not want to split your function implementation on multi lines.
+" IE: Test_Member_Function_B3(int _iSomeNum2/*= 5*/, char * _cpStr/*= "Yea buddy!"*/)
+"
+" PutAfterFlag:
+" let g:ghph_PutAfter = 1
+" If you want GHPH to behave like p (put after the cursor) and add a blank
+" line.
+" let g:ghph_PutAfter = 0
+" If you want GHPH to behave like P (put before the cursor).
+"
+" SplitReturnFlag:
+" let g:ghph_SplitReturn = 1
+" If you want to split the line after return value declaration.
+" IE:
+" int
+" Test_Function(void)
+" let g:ghph_SplitReturn = 0
+" If you want return value and function name on the same line.
+" IE:
+" int Test_Function(void)
+"
+"
+" Examples:
+" Smallest Implimentation:
+" let g:ghph_ShowVirtual = 0
+" let g:ghph_ShowStatic = 0
+" let g:ghph_ShowDefaultParams = 1
+" IE: void Test_Member_Function_B3(int _iSomeNum2, char * _cpStr);
+" Verbose:
+" let g:ghph_ShowVirtual = 1
+" let g:ghph_ShowStatic = 1
+" let g:ghph_ShowDefaultParams = 3
+" IE: /*virtual*/ void Test_Member_Function_B3(int _iSomeNum2/*5*/, char * _cpStr/*"Yea buddy!"*/);
+" What I Like: (and the default)
+" let g:ghph_ShowVirtual = 0
+" let g:ghph_ShowStatic = 0
+" let g:ghph_ShowDefaultParams = 3
+" IE: void Test_Member_Function_B3(int _iSomeNum2/*5*/, char * _cpStr/*"Yea buddy!"*/);
+"
+" Override: (for :GHPH only)
+" If you would like to override the default action (i.e. you want to paste the
+" implimentation in your header file) you can specify an overide value on
+" the command line or as the optional parameter for
+" GrabFromHeaderPasteInSource().
+" Valid Override values are (text in the quotes) '0','h','g' to get the
+" decloration and '1','c' and 'p' to put (and make) the decloration.
+" See below under commands for an example :GH and :PH
+"
+"
+" Bit of trivia... GHPH.. get header, put (althought half the time I think
+" paste heh) header. ~shrug~ I needed a command name.... (Name it whatever
+" you wish, of course!)
+" }}}
+"*****************************************************************
+" Inspiration: {{{
+"{{{ [basic] Tip #335: Copy C++ function declaration into implementation file
+" tip karma Rating 5/2, Viewed by 49
+"
+"created: October 1, 2002 6:47 complexity: basic
+"author: Leif Wickland as of Vim: 5.7
+"
+"There's a handy plug in for MS Visual Studio called CodeWiz that has a nifty ability to copy a function declaration and deposit it into the implementation file on command. I actually missed while using vim, so I wrote an approximation of that capability. This isn't foolproof, but it works alright.
+"
+"" Copy Function Declaration from a header file into the implementation file.
+"nmap <F5> "lYml[[kw"cye'l
+"nmap <F6> ma:let @n=@/<cr>"lp==:s/\<virtual\>/\/\*&\*\//e<cr>:s/\<static\>/\/\*&\*\//e<cr>:s/\s*=\s*0\s*//e<cr>:s/(.\{-}\zs=\s*[^,)]\{-1,}\>\ze\(\*\/\)\@!.*)/\/\*&\*\//e<cr>:s/(.\{-}\zs=\s*[^,)]\{-1,}\>\ze\(\*\/\)\@!.*)/\/\*&\*\//e<cr>:s/(.\{-}\zs=\s*[^,)]\{-1,}\>\ze\(\*\/\)\@!.*)/\/\*&\*\//e<cr>:let @/=@n<cr>'ajf(b"cPa::<esc>f;s<cr>{<cr>}<cr><esc>kk
+"
+"To use this, source it into vim, for example by placing it in your vimrc, press F5 in normal mode with the cursor on the line in the header file that declares the function you wish to copy. Then go to your implementation file and hit F6 in normal mode with the cursor where you want the function implementation inserted.
+" }}}
+" Bits and pieces of Luc's scripts :)
+" }}}
+"*****************************************************************
+" Commands: {{{
+"*****************************************************************
+" NOTE: [Feral:286/02@19:02] If you would like to NOT mess with the global var
+" stuff and just want to define your options here, just unrem these lets and
+" set your values
+"let g:ghph_ShowVirtual = 1
+"let g:ghph_ShowStatic = 1
+"let g:ghph_ShowDefaultParams = 2
+"let g:ghph_GrabComments = 0
+"let g:ghph_Reformat = 1
+"let g:ghph_PutAfter = 1
+"let g:ghph_SplitReturn = 1
+"" to Define :GHPH
+"let g:ghph_useGHPH = 1
+"" to Define :GH and :PH
+"let g:ghph_useGHandPH = 1
+
+" default command choice:
+if !exists('g:ghph_useGHPH') && !exists('g:ghph_useGHandPH')
+ let g:ghph_useGHPH = 1
+" let g:ghph_useGHandPH = 1
+endif
+
+" GHPH Usage: {{{
+" In Header:
+" :GHPH
+" In Source:
+" :GHPH
+" Putting A Implimentation While In A Header:
+" :GHPH p
+" Getting A Decloration While In A Source File:
+" :GHPH g
+" }}}
+if !exists(":GHPH") && exists('g:ghph_useGHPH')
+ if g:ghph_useGHPH == 1
+:command -buffer -nargs=? GHPH call <SID>GrabFromHeaderPasteInSource(<f-args>)
+ endif
+endif
+
+"[Feral:286/02@17:08] More normal commands, one to get the header and one to
+" paste the header.
+" GH And PH Usage: {{{
+" In Header:
+" :GH
+" In Source:
+" :PH
+" Putting A Implimentation While In A Header:
+" :PH
+" Getting A Decloration While In A Source File:
+" :GH
+" Note:
+" This is very straight forward, when you want to get a decloration you :GH
+" when you want to put a implimentation you :PH
+" }}}
+if !exists(":GH") && exists('g:ghph_useGHandPH')
+ if g:ghph_useGHandPH == 1
+:command -buffer -nargs=0 GH call <SID>GrabFromHeaderPasteInSource('g')
+ endif
+endif
+
+if !exists(":PH") && exists('g:ghph_useGHandPH')
+ if g:ghph_useGHandPH == 1
+:command -buffer -nargs=0 PH call <SID>GrabFromHeaderPasteInSource('p')
+ endif
+endif
+"}}}
+"*****************************************************************
+
+
+
+
+"
+" EOF
diff --git a/d/tools/vim/ftplugin/help.vim b/d/tools/vim/ftplugin/help.vim
new file mode 100644
index 0000000..bc80f08
--- /dev/null
+++ b/d/tools/vim/ftplugin/help.vim
@@ -0,0 +1,17 @@
+" Vim filetype plugin file
+" Language: help files
+" Maintainer: Nicolas Schodet <schodet@efrei.fr>
+" Last Change: Monday 27 January 2003
+
+" Only do this when not done yet for this buffer
+if exists("b:did_ftplugin")
+ finish
+endif
+
+" Don't load another plugin for this buffer
+let b:did_ftplugin = 1
+
+nnoremap <buffer> <CR> <C-]>
+nnoremap <buffer> <BS> <C-T>
+nnoremap <buffer> + /\(['\|]\)[^'\|]\{2,\}\1/b+<CR>
+nnoremap <buffer> - ?\(['\|]\)[^'\|]\{2,\}\1?b+<CR>
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
diff --git a/d/tools/vim/plugin/template.vim b/d/tools/vim/plugin/template.vim
new file mode 100644
index 0000000..7158986
--- /dev/null
+++ b/d/tools/vim/plugin/template.vim
@@ -0,0 +1,127 @@
+" Name: ni-template
+" Author: Nicolas Schodet <schodet@efrei.fr>
+" Last Update: 2005-07-23
+" Version: 0.83
+" Description: Chargeur de templates.
+" License: Domaine public.
+" Installation: Mettre le script dans &runtimepath/plugin, et les templates
+" dans &runtimepath/templates.
+"
+" Appeler la commande :Template [filetype] pour charger un
+" template. filetype est optionnel, il est detecté sinon.
+"
+" La commande :TemplateHeader essaye de détecter si le fichier
+" est un en-tête (h au lieu de c, hpp au lieu de cpp).
+"
+" Exemple : Mettre le script dans ~/.vim/plugin, et les
+" templates dans ~/.vim/templates. Mettre une autocommande :
+" au BufNewFile * TemplateHeader
+"
+" Usage: Les fichiers de templates peuvent contenir des expressions
+" remplacées par le script :
+" @DATE@ : Tue Jan 28 00:42:47 2003
+" @ISODATE@ : 2003-01-28
+" @YEAR@ : 2003
+" @FILE@ : template.vim
+" @FILEBASE@ : template
+" @FILECAP@ : TEMPLATE_VIM
+" @FILEDEF@ : template_vim
+" @AUTHOR@ : valeur de g:fullname
+" @EMAIL@ : valeur de g:email
+" @NICK@ : valeur de g:nick
+" @WEB@ : valeur de g:web
+" @COPYRIGHT@ : valeur de g:copyright
+" @%...@ : utilise expand pour construire un nom de fichier
+" @!...@ : evalue une expression VIM
+" @=...@ : evalue une expression VIM et remplace par le
+" résultat.
+
+if exists('g:ni_template_plugin') | finish | endif
+let g:ni_template_plugin = 1
+
+function! s:Eval(expr)
+ exe 'return' a:expr
+endf
+
+function! s:Exec(expr)
+ exe a:expr
+ return ''
+endf
+
+" Find a template file for a given filetype.
+function! s:Template_find_file(ft)
+ if exists ('b:template_variant')
+ let template_file = globpath (&runtimepath, 'templates/' . b:template_variant . '.' . a:ft)
+ if filereadable (template_file)
+ return template_file
+ endif
+ endif
+ if exists ('g:template_variant')
+ let template_file = globpath (&runtimepath, 'templates/' . g:template_variant . '.' . a:ft)
+ if filereadable (template_file)
+ return template_file
+ endif
+ endif
+ let template_file = globpath (&runtimepath, 'templates/default.' . a:ft)
+ return template_file
+endf
+
+" Insert template.
+function! s:Template(...)
+ let dellast = line ('$') == 1 && getline ('$') == ''
+ let ft = (a:0) ? (a:1) : (strlen (&ft) ? &ft : 'default')
+ let template_file = s:Template_find_file (ft)
+ if filereadable (template_file)
+ silent exe '0r ' . template_file
+ keepjumps silent %s/@=\([^@]*\)@/\=s:Eval(submatch(1))/ge
+ keepjumps silent %s/@!\([^@]*\)@/\=s:Exec(submatch(1))/ge
+ keepjumps silent %s/@\(%[^@]*\)@/\=expand(submatch(1))/ge
+ silent exe 'keepjumps %s/@DATE@/' . strftime ('%c') . '/ge'
+ silent exe 'keepjumps %s/@ISODATE@/' . strftime ('%Y-%m-%d') . '/ge'
+ silent exe 'keepjumps %s/@YEAR@/' . strftime ('%Y') . '/ge'
+ let file = expand ('%:t')
+ silent exe 'keepjumps %s/@FILE@/' . file . '/ge'
+ silent exe 'keepjumps %s/@FILEBASE@/' . expand ('%:t:r') . '/ge'
+ silent exe 'keepjumps %s/@FILECAP@/' . toupper (substitute (file, '\.', '_', 'g')) . '/ge'
+ silent exe 'keepjumps %s/@FILEDEF@/' . substitute (file, '\.', '_', 'g') . '/ge'
+ if exists ('g:fullname')
+ silent exe 'keepjumps %s/@AUTHOR@/' . g:fullname . '/ge'
+ endif
+ if exists ('g:email')
+ silent exe 'keepjumps %s/@EMAIL@/' . g:email . '/ge'
+ endif
+ if exists ('g:nick')
+ silent exe 'keepjumps %s/@NICK@/' . g:nick . '/ge'
+ endif
+ if exists ('g:web')
+ silent exe 'keepjumps %s/@WEB@/' . g:web . '/ge'
+ endif
+ if exists ('g:copyright')
+ silent exe 'keepjumps %s/@COPYRIGHT@/' . g:copyright . '/ge'
+ endif
+ if dellast
+ keepjumps $d _
+ endif
+ keepjumps 0
+ endif
+endf
+
+" Detect headers files, then call Template().
+function! s:TemplateHeader()
+ if &filetype == 'c' && expand ('%') =~ '\.h$'
+ call s:Template ('h')
+ elseif &filetype == 'cpp' && expand ('%') =~ '\.\(h\|H\|hh\|hxx\|hpp\|tcc\|inl\)$'
+ call s:Template ('hpp')
+ else
+ call s:Template ()
+ endif
+endfunction
+
+if !exists(':Template')
+ command -nargs=? Template :call s:Template (<f-args>)
+endif
+
+if !exists(':TemplateHeader')
+ command -nargs=0 TemplateHeader :call s:TemplateHeader ()
+endif
+
diff --git a/d/tools/vim/plugin/utils.vim b/d/tools/vim/plugin/utils.vim
new file mode 100644
index 0000000..a9ccd11
--- /dev/null
+++ b/d/tools/vim/plugin/utils.vim
@@ -0,0 +1,26 @@
+" Name: ni-utils
+" Author: Nicolas Schodet <schodet@efrei.fr>
+" Last Update: 2005-07-23
+" Description: Utilitaires divers
+" License: Domaine public.
+" Installation: Mettre le script dans &runtimepath/plugin.
+
+if exists('g:ni_utils_plugin') | finish | endif
+let g:ni_utils_plugin = 1
+
+" Recherche README dans `.' et `..' pour y lire le nom du prog et sa
+" description.
+function! GetReadme()
+ if filereadable ('README')
+ let readme = 'README'
+ elseif filereadable ('../README')
+ let readme = '../README'
+ endif
+ if exists ('readme')
+ let progname = substitute (system ('head -1 ' . readme), "\n", '', '')
+ else
+ let progname = ''
+ endif
+ return progname
+endfunction
+
diff --git a/d/tools/vim/syntax/aft.vim b/d/tools/vim/syntax/aft.vim
new file mode 100644
index 0000000..7ab56d2
--- /dev/null
+++ b/d/tools/vim/syntax/aft.vim
@@ -0,0 +1,201 @@
+" Vim syntax file
+" Language: AFT
+" Maintainers: David Bourgeois <dbourgeo@thezone.net>
+" Last Change: 2002 March 6
+
+" The main caveat is that hilighting indicates certain character sequences.
+" They may or may not be meaningful, depending on context. In addition,
+" some character sequences can color out others (usually contained), even
+" when they might be meaningful. I.E. if *bold* were colored red, but
+" contained in another syntax element, it won't be red. Since lots of things
+" can contain lots of other things, this is a limitation unless we are willing
+" to write a lot of "contains" statements and debug them.
+
+" There are various methods for loading the syntax file. You could just
+" ":source" it, or use the vim comment method. Better, see ":he syntax"
+" on how to automate the file for all "*aft" files, say.
+
+" The method I use requires root access (on unix), usually, to something
+" like /usr/share/vim/vim56. Put THIS file in $VIMRUNTIME/syntax/.
+" Edit $VIMRUNTIME/syntax/synload.vim and add a line: "SynAu aft".
+" Finally, edit $VIMRUNTIME/filetype.vim and add a line:
+" :autocmd BufRead,BufNewFile *.aft set ft=aft
+" You can change "*.aft" to whatever scheme you like. Eg. *.aft,minutes*.txt
+" I don't know what to do with vim 6.
+
+" General blathering comments.
+" ----------------------------
+" I'm a newbie to vim, so this is far from perfect, but provides useful
+" 'reminders' that work for me. Use the syntax coloring as guidance only. After
+" you get used to it, I hope you find it useful. Any help in improving this
+" would be much appreciated. I tried several different detailed routes that
+" really taxed the syntax system (and my understanding of it), and short of
+" writing an aft parser in the syntax system (REALLY unsuited for this), or the
+" obverse of settling on highlighting a few 'keywords' and other simple items,
+" this will do for my purposes.
+
+" Also, short of writing tedious functions that somehow construct a syntax
+" file, I see no elegant way of accounting for various tab sizes. The
+" only possibility I could see, on somewhat cursory inspection, would be to
+" use a set command to inform this file of the desired tab size and copy all
+" the relevant code into 'if' blocks for each desired tab size (3,4,8, etc.),
+" with the regular expressions suitably changed about.
+" You would then set a variable via the set command, such as aft_tabstops.
+
+" N.B. This file needs #---TABSTOP=3.
+" Also, you can see a demo of the syntax in syntax-demo.aft.
+
+" Remove any old syntax stuff hanging around.
+syn clear
+
+" Aft is case sensitive, when you are matching comment constructs.
+syn case match
+syn sync ccomment maxlines=50
+
+"Sections and stuff.
+"-------------------
+syn match aftSection /^\*\{1,4}/
+syn match aftSection /^\*Title:/
+syn match aftSection /^\*Author:/
+"Note, other text right after TOC gets eaten, so OK.
+syn match aftSection /^\*TOC/
+syn match aftSection /^\*Image:/
+syn match aftSection /^\*Image-left:/
+syn match aftSection /^\*Image-right:/
+syn match aftSection /^\*Image-center:/
+syn match aftSection /^\*Include:/
+syn match aftSection /^\*Insert:/
+
+"Tab modes.
+"Continuation mode, verbatim mode.
+"---------------------------------
+"You can be in tab mode without the hilight showing, owing to the one character
+"hilight. This is just here as a slightly helpful reminder, and I find a full
+"line annoying. (It also can cause later regions to bleed.)
+"We won't even get into whether a single or double tabbed bullet, etc., is
+"supposed to be a bullet or something else, depending on the situation. It's
+"just flagged as a potential bullet. Likewise, something colored as centred
+"may not be (eg. it may be a continuation), we are really marking that
+"there are one or two tabs or more in front, that's all.
+"Also, we won't mark a hard tab followed by tabstob number of spaces.
+
+"If you don't want this, comment out the two syn aftTab lines below.
+
+"N.B. Change {3} to {8} for regular tabs (spaces). \t, of course, stands
+"for a tab.
+
+"Match general tab, continuation mode. Causes funny face stuff.
+"(Only if the face character starts directly after a tab.)
+"Hence, the weird regexp. Note minor error with the single ' for italic
+"in hilighting faces. (Two chars will mark the tabbed column.)
+"The characters: },{, and % won't be colored in any tab position.
+syn match aftTab /^\( \{3}\|\t\)\('[^']\|[^_'|~}{%]\)/
+syn match aftTab /^\( \{3}\|\t\)\(\(mailto\)\|\(ftp\)\|\(http[s]*\)\|\(file\)\)/
+
+"-- Centred line mode. --
+"Should be before all other tab modes. Again, eg. lines that start
+"with a face etc. won't be colored centered, even though they are, else
+"you get bleeding for these regions. Again, I highlight an extra
+"char for targets and references, similar to italics in general
+"tab mode. Also, a plain number won't be hilighted, even though centered.
+"Likewise, plain } (not }+, etc.). Generally, both ends of the target or ref.
+"will light up in all positions.
+
+"All somewhat crufty. (If you left out the tab and centre matches, would
+"be pretty consistent coloring.)
+
+"Comment out these two lines if you don't want centre hilighting.
+"Note, it finds double tabbing, right....
+syn match aftCenter /^\( \{6}\|\t\t\)\('[^']\|[^_'|~}{%]\)/
+syn match aftCenter /^\( \{6}\|\t\t\)\(\(mailto\)\|\(ftp\)\|\(http[s]*\)\|\(file\)\)/
+
+"-- Tab list modes. --
+" The next three allow multiple levels of indent.
+syn match aftList /^\( \{3}\|\t\)\+[0-9]\+[.)]/
+syn match aftBullet /^\( \{3}\|\t\)\+\*\{1}/
+"Need both halves of the named list bracket.
+syn region aftNamed oneline matchgroup=aftParen start=/^\( \{3}\|\t\)\+\[/
+ \ end=/]/
+"-- Other Tab modes --
+"Back to one level of indent.
+syn match aftQuote /^\( \{3}\|\t\)\#\{1}/
+syn match aftTable /^\( \{3}\|\t\)\!\{1}/
+
+
+"Literal mode. Not worried about font etc. hilighting (allowed only if
+"the Filter mode is on, we hilight in either case).
+"---------------------------------------------------------------------
+syn region aftLiteral start=/^^<<\(Filter\)*/ end=/^^>>/
+
+"Comment-like things. Includes PASS and TABSTOP.
+"-----------------------------------------------
+syn match aftComment /^[#C]---.*$/
+syn match aftComment /^----.*$/
+
+"Face changes.
+"-------------
+"Again, a face may not apply if its in a verbatim mode, etc.
+"Won't bother matching entire paragraphs. More work. Will match
+"the characters by themselves, though. (This needs to be first.)
+"Generally, the outer face wins. (Also applies to links and targets.)
+syn match aftParen /[_|~]\|''/
+syn match aftSet /%\S\+%/
+syn region aftBold matchgroup=aftParen start=/_/ skip=/__/ end=/_/ oneline
+syn region aftItalics matchgroup=aftParen start=/''/ skip=/''''/ end=/''/
+ \ oneline
+syn region aftTele matchgroup=aftParen start=/|/ skip=/||/ end=/|/ oneline
+syn region aftSmall matchgroup=aftParen start=/\~/
+ \ skip=/\~\~/ end=/\~/ oneline
+"Watch out for http /~. Hilight starts at the end. There could be other
+"gotchas like this. I am a Pooh of small brain.
+syn region aftSmall start=/\/\~/hs=s+2 end=/.\{-}/ oneline
+
+
+"Targets and References.
+"-----------------------
+syn region aftTarget matchgroup=aftParen oneline start=/}+/ end=/+{/
+syn region aftTarget matchgroup=aftParen oneline start=/}-/ end=/-{/
+syn region aftRefer matchgroup=aftParen oneline start=/{+/ end=/+}/
+syn region aftRefer matchgroup=aftParen oneline start=/{-/ end=/-}/
+
+"Plain Old URL Targets.
+"----------------------
+syn keyword aftPOURL http https ftp mailto file
+
+"Tab size stub.
+if exists("aft_tabstops")
+ " Need to be able to deal with different tabstop sizes.
+ " You could branch depending on the value of aft_tabstops.
+ " A reminder stub for now. You would have to reproduce the
+ " entire tab section for each tab size AFAIK.
+endif
+
+if !exists("did_aft_syntax_inits")
+ " The default methods for highlighting. Can be overridden later
+ " Or you can enter in the colors directly: see ":he syntax".
+ let did_aft_syntax_inits = 1
+ hi link aftSection Statement
+ hi link aftCenter Identifier
+ hi link aftTab Identifier
+ hi link aftList Statement
+ hi link aftBullet Statement
+ hi link aftNamed Statement
+ hi link aftParen Constant
+ hi link aftQuote Statement
+ hi link aftTable Statement
+ hi link aftLiteral Special
+ hi link aftComment Comment
+ hi link aftBold Type
+ hi link aftItalics Type
+ hi link aftTele Type
+ hi link aftSmall Type
+ hi link aftTarget Special
+ hi link aftRefer Special
+ hi link aftPOURL Identifier
+ hi link aftSet Constant
+ hi link aftIgnore Ignore
+endif
+
+let b:current_syntax = "aft"
+
+" vim: ts=28
diff --git a/d/tools/vim/templates/robot.README b/d/tools/vim/templates/robot.README
new file mode 100644
index 0000000..6aa24b0
--- /dev/null
+++ b/d/tools/vim/templates/robot.README
@@ -0,0 +1,24 @@
+« name » - « one line description ».
+
+« long description »
+
+
+Copyright (C) @YEAR@ @AUTHOR@
+
+Robot APB Team/Efrei 2006.
+ Web: http://assos.efrei.fr/robot/
+ Email: robot AT efrei DOT fr
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
diff --git a/d/tools/vim/templates/robot.c b/d/tools/vim/templates/robot.c
new file mode 100644
index 0000000..b2bfba0
--- /dev/null
+++ b/d/tools/vim/templates/robot.c
@@ -0,0 +1,29 @@
+/* @FILE@ */
+/* @=GetReadme()@ {{{
+ *
+ * Copyright (C) @YEAR@ @AUTHOR@
+ *
+ * Robot APB Team/Efrei 2006.
+ * Web: http://assos.efrei.fr/robot/
+ * Email: robot AT efrei DOT fr
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * }}} */
+#include "@FILEBASE@.h"
+
+/* +AutoDec */
+/* -AutoDec */
+
diff --git a/d/tools/vim/templates/robot.cpp b/d/tools/vim/templates/robot.cpp
new file mode 100644
index 0000000..db41502
--- /dev/null
+++ b/d/tools/vim/templates/robot.cpp
@@ -0,0 +1,26 @@
+// @FILE@
+// @=GetReadme()@ {{{
+//
+// Copyright (C) @YEAR@ @AUTHOR@
+//
+// Robot APB Team/Efrei 2006.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+#include "@FILEBASE@.hh"
+
diff --git a/d/tools/vim/templates/robot.h b/d/tools/vim/templates/robot.h
new file mode 100644
index 0000000..5d490ba
--- /dev/null
+++ b/d/tools/vim/templates/robot.h
@@ -0,0 +1,31 @@
+#ifndef @FILEDEF@
+#define @FILEDEF@
+/* @FILE@ */
+/* @=GetReadme()@ {{{
+ *
+ * Copyright (C) @YEAR@ @AUTHOR@
+ *
+ * Robot APB Team/Efrei 2006.
+ * Web: http://assos.efrei.fr/robot/
+ * Email: robot AT efrei DOT fr
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * }}} */
+
+/* +AutoDec */
+/* -AutoDec */
+
+#endif /* @FILEDEF@ */
diff --git a/d/tools/vim/templates/robot.hpp b/d/tools/vim/templates/robot.hpp
new file mode 100644
index 0000000..c8ac592
--- /dev/null
+++ b/d/tools/vim/templates/robot.hpp
@@ -0,0 +1,28 @@
+#ifndef @FILEDEF@
+#define @FILEDEF@
+// @FILE@
+// @=GetReadme()@ {{{
+//
+// Copyright (C) @YEAR@ @AUTHOR@
+//
+// Robot APB Team/Efrei 2006.
+// Web: http://assos.efrei.fr/robot/
+// Email: robot AT efrei DOT fr
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//
+// }}}
+
+#endif // @FILEDEF@