home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / mac / vim55rt.sit / runtime / syntax / spice.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  2.2 KB  |  72 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:     Spice circuit simulator input netlist
  3. " Maintainer:   Noam Halevy <Noam.Halevy.motorola.com>
  4. " Last change:  12/08/99
  5. "
  6. " This is based on sh.vim by Lennart Schultz
  7. " but greatly simplified
  8.  
  9. " Remove any old syntax stuff hanging around
  10. syn clear
  11. " spice syntax is case INsensitive
  12. syn case ignore
  13.  
  14. syn keyword    spiceTodo    contained TODO
  15.  
  16. syn match spiceComment  "^ \=\*.*$"
  17. syn match spiceComment  "\$.*$"
  18.  
  19. " Numbers, all with engineering suffixes and optional units
  20. "==========================================================
  21. "floating point number, with dot, optional exponent
  22. syn match spiceNumber  "\<[0-9]\+\.[0-9]*\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
  23. "floating point number, starting with a dot, optional exponent
  24. syn match spiceNumber  "\.[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
  25. "integer number with optional exponent
  26. syn match spiceNumber  "\<[0-9]\+\(e[-+]\=[0-9]\+\)\=\(meg\=\|[afpnumkg]\)\="
  27.  
  28. " Misc
  29. "=====
  30. syn match   spiceWrapLineOperator       "\\$"
  31. syn match   spiceWrapLineOperator       "^+"
  32.  
  33. syn match   spiceStatement      "^ \=\.\I\+"
  34.  
  35. " Matching pairs of parentheses
  36. "==========================================
  37. syn region  spiceParen transparent matchgroup=spiceOperator start="(" end=")" contains=ALLBUT,spiceParenError
  38. syn region  spiceSinglequote matchgroup=spiceOperator start=+'+ end=+'+
  39.  
  40. " Errors
  41. "=======
  42. syn match spiceParenError ")"
  43.  
  44. " Syncs
  45. " =====
  46. syn sync minlines=50
  47.  
  48. if !exists("did_spice_syntax_inits")
  49.   let did_spice_syntax_inits = 1
  50. " The default methods for highlighting.  Can be overridden later
  51.   hi link spiceTodo    Todo
  52.   hi link spiceWrapLineOperator spiceOperator
  53.   hi link spiceSinglequote      spiceExpr
  54.   hi link spiceExpr             Function
  55.   hi link spiceParenError       Error
  56.   hi link spiceStatement        Statement
  57.   hi link spiceNumber           Number
  58.   hi link spiceComment          Comment
  59.   hi link spiceOperator         Operator
  60. endif
  61.  
  62. let b:current_syntax = "spice"
  63.  
  64. " insert the following to $VIM/syntax/scripts.vim
  65. " to autodetect HSpice netlists and text listing output:
  66. "
  67. " " Spice netlists and text listings
  68. " elseif getline(1) =~ 'spice\>' || getline("$") =~ '^\.end'
  69. "   so <sfile>:p:h/spice.vim
  70.  
  71. " vim: ts=8
  72.