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 / fvwm.vim < prev    next >
Encoding:
Text File  |  1999-09-25  |  11.8 KB  |  242 lines  |  [TEXT/VIM!]

  1. " Vim syntax file
  2. " Language:    Fvwm{1,2} configuration file
  3. " Maintainer:    Haakon Riiser <hakonrk@fys.uio.no>
  4. " Last change:    1999 Jun 29
  5.  
  6. " Clear old syntax defs
  7. syn clear
  8.  
  9. " Fvwm configuration files are case insensitive
  10. syn case ignore
  11.  
  12. set iskeyword=_,-,+,.,a-z,A-Z,48-57
  13.  
  14. " Read system colors from the color database (rgb.txt)
  15. if exists("rgb_file")
  16.     " We don't want any hit-return prompts, so we make sure that
  17.     " &shortmess is set to `O'
  18.     let __fvwm_oldshm = &shortmess
  19.     set shortmess=O
  20.  
  21.     " And we set &report to a huge number, so that no hit-return prompts
  22.     " will be given
  23.     let __fvwm_oldreport = &report
  24.     set report=10000
  25.  
  26.     " Append the color database to the fvwm configuration, and read the
  27.     " colors from this buffer
  28.     let __fvwm_i = line("$") + 1
  29.     exe "$r" rgb_file
  30.     let __fvwm_lastline = line("$")
  31.     while __fvwm_i <= __fvwm_lastline
  32.     let __fvwm_s = matchstr(getline(__fvwm_i), '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\h.*$')
  33.     if __fvwm_s != ""
  34.         exe "syn keyword fvwmColors ".substitute(__fvwm_s, '^\s*\d\+\s\+\d\+\s\+\d\+\s\+\(\h.*\)$', '\1', "")
  35.     endif
  36.     let __fvwm_i = __fvwm_i + 1
  37.     endwhile
  38.  
  39.     " Remove the appended data
  40.     undo
  41.  
  42.     " Goto first line again
  43.     1
  44.  
  45.     " and restore the old values of the variables
  46.     let &shortmess = __fvwm_oldshm
  47.     let &report = __fvwm_oldreport
  48.     unlet __fvwm_i __fvwm_s __fvwm_lastline __fvwm_oldshm __fvwm_oldreport
  49. endif
  50. " done reading colors
  51.  
  52. syn match   fvwmWhitespace    "\s\+" contained
  53. syn match   fvwmEnvVar        "\$\w\+"
  54. syn match   fvwmModConf        "^\s*\*\a\+" contains=fvwmWhitespace
  55. syn match   fvwmString        '".\{-}"'
  56. syn match   fvwmRGBValue    "#\x\{3}"
  57. syn match   fvwmRGBValue    "#\x\{6}"
  58. syn match   fvwmRGBValue    "#\x\{9}"
  59. syn match   fvwmRGBValue    "#\x\{12}"
  60. syn match   fvwmRGBValue    "rgb:\x\{1,4}/\x\{1,4}/\x\{1,4}"
  61. syn match   fvwmPath        "\<IconPath\s.*$"lc=8 contains=fvwmEnvVar
  62. syn match   fvwmPath        "\<ModulePath\s.*$"lc=10 contains=fvwmEnvVar
  63. syn match   fvwmPath        "\<PixmapPath\s.*$"lc=10 contains=fvwmEnvVar
  64. syn match   fvwmModule        "\<Module\s\+\w\+"he=s+6
  65. syn match   fvwmKey        "\<Key\s\+\w\+"he=s+3
  66.  
  67. if bufname("%") =~ ".*fvwmrc.*"
  68.     syn match  fvwmEnvVar    "\$(\w\+)"
  69.     syn region fvwmStyle    matchgroup=fvwmFunction start="^\s*Style\>"hs=e-5 end="$" oneline keepend contains=fvwmString,fvwmKeyword,fvwmWhiteSpace
  70.  
  71.     syn keyword fvwmFunction    AppsBackingStore AutoRaise BackingStore
  72.     syn keyword fvwmFunction    Beep BoundaryWidth ButtonStyle
  73.     syn keyword fvwmFunction    CenterOnCirculate CirculateDown
  74.     syn keyword fvwmFunction    CirculateHit CirculateSkip
  75.     syn keyword fvwmFunction    CirculateSkipIcons CirculateUp
  76.     syn keyword fvwmFunction    ClickTime ClickToFocus Close Cursor
  77.     syn keyword fvwmFunction    CursorMove DecorateTransients Delete
  78.     syn keyword fvwmFunction    Desk DeskTopScale DeskTopSize Destroy
  79.     syn keyword fvwmFunction    DontMoveOff EdgeResistance EdgeScroll
  80.     syn keyword fvwmFunction    EndFunction EndMenu EndPopup Focus
  81.     syn keyword fvwmFunction    Font Function GotoPage HiBackColor
  82.     syn keyword fvwmFunction    HiForeColor Icon IconBox IconFont
  83.     syn keyword fvwmFunction    Iconify IconPath Key Lenience Lower
  84.     syn keyword fvwmFunction    Maximize MenuBackColor MenuForeColor
  85.     syn keyword fvwmFunction    MenuStippleColor Module ModulePath Mouse
  86.     syn keyword fvwmFunction    Move MWMBorders MWMButtons MWMDecorHints
  87.     syn keyword fvwmFunction    MWMFunctionHints MWMHintOverride MWMMenus
  88.     syn keyword fvwmFunction    NoBorder NoBoundaryWidth Nop NoPPosition
  89.     syn keyword fvwmFunction    NoTitle OpaqueMove OpaqueResize Pager
  90.     syn keyword fvwmFunction    PagerBackColor PagerFont PagerForeColor
  91.     syn keyword fvwmFunction    PagingDefault PixmapPath Popup Quit Raise
  92.     syn keyword fvwmFunction    RaiseLower RandomPlacement Refresh Resize
  93.     syn keyword fvwmFunction    Restart SaveUnders Scroll SloppyFocus
  94.     syn keyword fvwmFunction    SmartPlacement StartsOnDesk StaysOnTop
  95.     syn keyword fvwmFunction    StdBackColor StdForeColor Stick Sticky
  96.     syn keyword fvwmFunction    StickyBackColor StickyForeColor
  97.     syn keyword fvwmFunction    StickyIcons StubbornIconPlacement
  98.     syn keyword fvwmFunction    StubbornIcons StubbornPlacement
  99.     syn keyword fvwmFunction    SuppressIcons Title TogglePage Wait Warp
  100.     syn keyword fvwmFunction    WindowFont WindowList WindowListSkip
  101.     syn keyword fvwmFunction    WindowsDesk WindowShade XORvalue
  102.  
  103.     " These keywords are only used after the "Style" command.  To avoid
  104.     " name collision with several commands, they are contained.
  105.     syn keyword fvwmKeyword    BackColor BorderWidth BoundaryWidth contained
  106.     syn keyword fvwmKeyword    Button CirculateHit CirculateSkip Color contained
  107.     syn keyword fvwmKeyword    DoubleClick ForeColor Handles HandleWidth contained
  108.     syn keyword fvwmKeyword    Icon IconTitle NoBorder NoBoundaryWidth contained
  109.     syn keyword fvwmKeyword    NoButton NoHandles NoIcon NoIconTitle contained
  110.     syn keyword fvwmKeyword    NoTitle Slippery StartIconic StartNormal contained
  111.     syn keyword fvwmKeyword    StartsAnyWhere StartsOnDesk StaysOnTop contained
  112.     syn keyword fvwmKeyword    StaysPut Sticky Title WindowListHit contained
  113.     syn keyword fvwmKeyword    WindowListSkip contained
  114. elseif bufname("%") =~ ".*fvwm2rc.*"
  115.     syn match   fvwmEnvVar    "\${\w\+}"
  116.     syn match   fvwmDef        '^\s*+\s*".\{-}"' contains=fvwmMenuString,fvwmWhitespace
  117.     syn match   fvwmIcon    '%.\{-}%' contained
  118.     syn match   fvwmIcon    '\*.\{-}\*' contained
  119.     syn match   fvwmMenuString    '".\{-}"' contains=fvwmIcon,fvwmShortcutKey contained
  120.     syn match   fvwmShortcutKey    "&." contained
  121.     syn match   fvwmModule    "\<KillModule\s\+\w\+"he=s+10
  122.     syn match   fvwmModule    "\<SendToModule\s\+\w\+"he=s+12
  123.     syn match   fvwmModule    "\<DestroyModuleConfig\s\+\w\+"he=s+19
  124.  
  125.     syn keyword fvwmFunction    AddButtonStyle AddTitleStyle AddToDecor
  126.     syn keyword fvwmFunction    AddToFunc AddToMenu AnimatedMove Beep
  127.     syn keyword fvwmFunction    BorderStyle ButtonStyle ChangeDecor
  128.     syn keyword fvwmFunction    ChangeMenuStyle ClickTime Close
  129.     syn keyword fvwmFunction    ColorLimit ColormapFocus Current
  130.     syn keyword fvwmFunction    CursorMove CursorStyle DefaultColors
  131.     syn keyword fvwmFunction    DefaultFont Delete Desk DeskTopSize
  132.     syn keyword fvwmFunction    Destroy DestroyDecor DestroyFunc
  133.     syn keyword fvwmFunction    DestroyMenu DestroyMenuStyle Direction
  134.     syn keyword fvwmFunction    Echo EdgeResistance EdgeScroll
  135.     syn keyword fvwmFunction    EdgeThickness Emulate ExecUseShell
  136.     syn keyword fvwmFunction    ExitFunction FlipFocus Focus Function
  137.     syn keyword fvwmFunction    GlobalOpts GotoPage HilightColor IconFont
  138.     syn keyword fvwmFunction    Iconify IconPath Lower Maximize Menu
  139.     syn keyword fvwmFunction    MenuStyle ModulePath Mouse Move MoveToDesk
  140.     syn keyword fvwmFunction    MoveToPage Next None Nop OpaqueMoveSize
  141.     syn keyword fvwmFunction    PipeRead PixmapPath Popup Prev Quit
  142.     syn keyword fvwmFunction    QuitScreen Raise RaiseLower Read Recapture
  143.     syn keyword fvwmFunction    Refresh RefreshWindow Resize Restart
  144.     syn keyword fvwmFunction    Scroll SetAnimation SetEnv SetMenuDelay
  145.     syn keyword fvwmFunction    SetMenuStyle SnapAttraction SnapGrid
  146.     syn keyword fvwmFunction    Stick Style Title TitleStyle UpdateDecor
  147.     syn keyword fvwmFunction    Wait WarpToWindow WindowFont WindowId
  148.     syn keyword fvwmFunction    WindowList WindowsDesk WindowShade
  149.     syn keyword fvwmFunction    XORvalue
  150.  
  151.     syn keyword fvwmKeyword    Active ActiveDown ActiveFore
  152.     syn keyword fvwmKeyword    ActiveForeOff ActivePlacement
  153.     syn keyword fvwmKeyword    ActivePlacementHonorsStartsOnPage
  154.     syn keyword fvwmKeyword    ActivePlacementIgnoresStartsOnPage
  155.     syn keyword fvwmKeyword    ActiveUp All Alphabetic Animation
  156.     syn keyword fvwmKeyword    AnimationOff BackColor Background
  157.     syn keyword fvwmKeyword    BGradient BorderWidth Bottom
  158.     syn keyword fvwmKeyword    Button CaptureHonorsStartsOnPage
  159.     syn keyword fvwmKeyword    CaptureIgnoresStartsOnPage Centered
  160.     syn keyword fvwmKeyword    CirculateHit CirculateHitIcon
  161.     syn keyword fvwmKeyword    CirculateSkip CirculateSkipIcon Clear
  162.     syn keyword fvwmKeyword    ClickToFocus ClickToFocusDoesntPassClick
  163.     syn keyword fvwmKeyword    ClickToFocusDoesntRaise
  164.     syn keyword fvwmKeyword    ClickToFocusPassesClick ClickToFocusRaises
  165.     syn keyword fvwmKeyword    Color CurrentDesk CurrentPage
  166.     syn keyword fvwmKeyword    CurrentPageAnyDesk DecorateTransient
  167.     syn keyword fvwmKeyword    Default DGradient DoubleClickTime Down
  168.     syn keyword fvwmKeyword    DumbPlacement East Flat FocusFollowsMouse
  169.     syn keyword fvwmKeyword    FollowsFocus FollowsMouse Font ForeColor
  170.     syn keyword fvwmKeyword    Foreground FVWM FvwmBorder FvwmButtons
  171.     syn keyword fvwmKeyword    Greyed Handles HandleWidth Height
  172.     syn keyword fvwmKeyword    HGradient HiddenHandles Hilight3DOff
  173.     syn keyword fvwmKeyword    Hilight3DThick Hilight3DThin HilightBack
  174.     syn keyword fvwmKeyword    HilightBackOff HintOverride Icon IconBox
  175.     syn keyword fvwmKeyword    IconFill IconGrid Iconic Icons IconTitle
  176.     syn keyword fvwmKeyword    Inactive Interior Item Left LeftJustified
  177.     syn keyword fvwmKeyword    Lenience Maximized MenuFace MiniIcon
  178.     syn keyword fvwmKeyword    MouseFocus MouseFocusClickDoesntRaise
  179.     syn keyword fvwmKeyword    MouseFocusClickRaises MWM MWMBorder
  180.     syn keyword fvwmKeyword    MWMButtons MWMDecor MWMDecorMax
  181.     syn keyword fvwmKeyword    MWMDecorMenu MWMDecorMin MWMFunctions
  182.     syn keyword fvwmKeyword    NakedTransient NoButton NoDecorHint
  183.     syn keyword fvwmKeyword    NoDeskSort NoFuncHint NoGeometry
  184.     syn keyword fvwmKeyword    NoHandles NoIcon NoIcons NoIconTitle
  185.     syn keyword fvwmKeyword    NoInset NoLenience NoNormal NoOLDecor
  186.     syn keyword fvwmKeyword    NoOnTop NoOverride NoPPosition
  187.     syn keyword fvwmKeyword    Normal North Northeast Northwest
  188.     syn keyword fvwmKeyword    NoSticky NoStipledTitles NotAlphabetic
  189.     syn keyword fvwmKeyword    NoTitle NoWarp OLDecor Once OnlyIcons
  190.     syn keyword fvwmKeyword    OnlyNormal OnlyOnTop OnlySticky
  191.     syn keyword fvwmKeyword    OnTop Pixmap PopupDelay PopupDelayed
  192.     syn keyword fvwmKeyword    PopupImmediately PopupOffset Quiet
  193.     syn keyword fvwmKeyword    Raised RecaptureHonorsStartsOnPage
  194.     syn keyword fvwmKeyword    RecaptureIgnoresStartsOnPage Rectangle
  195.     syn keyword fvwmKeyword    Reset Right RightJustified Root
  196.     syn keyword fvwmKeyword    SameType SelectInPlace SelectWarp
  197.     syn keyword fvwmKeyword    SeparatorsLong SeparatorsShort ShowMapping
  198.     syn keyword fvwmKeyword    SideColor SidePic Simple SkipMapping
  199.     syn keyword fvwmKeyword    Slippery SlipperyIcon SloppyFocus
  200.     syn keyword fvwmKeyword    SmartPlacement SmartPlacementIsNormal
  201.     syn keyword fvwmKeyword    SmartPlacementIsReallySmart Solid
  202.     syn keyword fvwmKeyword    South Southeast Southwest StartIconic
  203.     syn keyword fvwmKeyword    StartNormal StartsAnyWhere StartsOnDesk
  204.     syn keyword fvwmKeyword    StartsOnPage StaysOnTop StaysPut
  205.     syn keyword fvwmKeyword    Sticky StickyIcon StipledTitles Sunk
  206.     syn keyword fvwmKeyword    TiledPixmap Title TitleUnderlines0
  207.     syn keyword fvwmKeyword    TitleUnderlines1 TitleUnderlines2
  208.     syn keyword fvwmKeyword    TitleWarp TitleWarpOff Top Transient
  209.     syn keyword fvwmKeyword    TrianglesRelief TrianglesSolid Up
  210.     syn keyword fvwmKeyword    UseBorderStyle UseDecor UseIconName
  211.     syn keyword fvwmKeyword    UsePPosition UseStyle UseTitleStyle
  212.     syn keyword fvwmKeyword    Vector VGradient Warp WarpTitle West
  213.     syn keyword fvwmKeyword    WIN WindowListHit WindowListSkip Windows
  214. endif
  215.  
  216. syn keyword fvwmExec        Exec
  217. syn match   fvwmComment        "^#.*$"
  218.  
  219. if !exists("did_fvwm_syntax_inits")
  220.     let did_fvwm_syntax_inits = 1
  221.     hi link fvwmComment        Comment
  222.     hi link fvwmEnvVar        Macro
  223.     hi link fvwmExec        Function
  224.     hi link fvwmFunction    Function
  225.     hi link fvwmIcon        Comment
  226.     hi link fvwmKey        Function
  227.     hi link fvwmKeyword        Keyword
  228.     hi link fvwmMenuString    String
  229.     hi link fvwmModConf        Macro
  230.     hi link fvwmModule        Function
  231.     hi link fvwmRGBValue    Type
  232.     hi link fvwmShortcutKey    SpecialChar
  233.     hi link fvwmString        String
  234.  
  235.     if exists("rgb_file")
  236.     hi link fvwmColors    Type
  237.     endif
  238. endif
  239.  
  240. let b:current_syntax = "fvwm"
  241. " vim: sts=4 sw=4 ts=8
  242.