decada.vim 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. "------------------------------------------------------------------------------
  2. " Description: Vim Ada/Dec Ada compiler file
  3. " Language: Ada (Dec Ada)
  4. " $Id: decada.vim 887 2008-07-08 14:29:01Z krischik $
  5. " Copyright: Copyright (C) 2006 Martin Krischik
  6. " Maintainer: Martin Krischik <krischik@users.sourceforge.net>
  7. " $Author: krischik $
  8. " $Date: 2008-07-08 16:29:01 +0200 (Di, 08 Jul 2008) $
  9. " Version: 4.6
  10. " $Revision: 887 $
  11. " $HeadURL: https://gnuada.svn.sourceforge.net/svnroot/gnuada/trunk/tools/vim/autoload/decada.vim $
  12. " History: 21.07.2006 MK New Dec Ada
  13. " 15.10.2006 MK Bram's suggestion for runtime integration
  14. " 05.11.2006 MK Bram suggested not to use include protection for
  15. " autoload
  16. " 05.11.2006 MK Bram suggested to save on spaces
  17. " Help Page: compiler-decada
  18. "------------------------------------------------------------------------------
  19. if version < 700
  20. finish
  21. endif
  22. function decada#Unit_Name () dict " {{{1
  23. " Convert filename into acs unit:
  24. " 1: remove the file extension.
  25. " 2: replace all double '_' or '-' with an dot (which denotes a separate)
  26. " 3: remove a trailing '_' (which denotes a specification)
  27. return substitute (substitute (expand ("%:t:r"), '__\|-', ".", "g"), '_$', "", '')
  28. endfunction decada#Unit_Name " }}}1
  29. function decada#Make () dict " {{{1
  30. let l:make_prg = substitute (g:self.Make_Command, '%<', self.Unit_Name(), '')
  31. let &errorformat = g:self.Error_Format
  32. let &makeprg = l:make_prg
  33. wall
  34. make
  35. copen
  36. set wrap
  37. wincmd W
  38. endfunction decada#Build " }}}1
  39. function decada#Set_Session (...) dict " {{{1
  40. if a:0 > 0
  41. call ada#Switch_Session (a:1)
  42. elseif argc() == 0 && strlen (v:servername) > 0
  43. call ada#Switch_Session (
  44. \ expand('~')[0:-2] . ".vimfiles.session]decada_" .
  45. \ v:servername . ".vim")
  46. endif
  47. return
  48. endfunction decada#Set_Session " }}}1
  49. function decada#New () " }}}1
  50. let Retval = {
  51. \ 'Make' : function ('decada#Make'),
  52. \ 'Unit_Name' : function ('decada#Unit_Name'),
  53. \ 'Set_Session' : function ('decada#Set_Session'),
  54. \ 'Project_Dir' : '',
  55. \ 'Make_Command' : 'ACS COMPILE /Wait /Log /NoPreLoad /Optimize=Development /Debug %<',
  56. \ 'Error_Format' : '%+A%%ADAC-%t-%m,%C %#%m,%Zat line number %l in file %f,' .
  57. \ '%+I%%ada-I-%m,%C %#%m,%Zat line number %l in file %f'}
  58. return Retval
  59. endfunction decada#New " }}}1
  60. finish " 1}}}
  61. "------------------------------------------------------------------------------
  62. " Copyright (C) 2006 Martin Krischik
  63. "
  64. " Vim is Charityware - see ":help license" or uganda.txt for licence details.
  65. "------------------------------------------------------------------------------
  66. " vim: textwidth=78 wrap tabstop=8 shiftwidth=3 softtabstop=3 noexpandtab
  67. " vim: foldmethod=marker