Sorry I forgot on the first mail but I had sent another along with it.
Anyway here it is again.

With regards to autodetection what text should I check for ?
At the monent I am checking for comment 
      
      "# This is the default menu file for Blackbox 0.33.0 and up" 

in the first line or
                               
                               "[begin]" 

in the first 5. What do people call there menu file ? This not a very
good way of catching all bbmenu files. For this reason I only include
the syntax file.

Hope you find it usefull

--
Simon
" Vim syntax file
" Language:     Blackbox menu file
" Maintainer:   Simon Brackenboro' <[EMAIL PROTECTED]>
" Last change:  08/01/00

" Remove any old syntax stuff hanging around
syn clear

syn case ignore

syn match bbmenuErr1            "[\[\](){}]"

syn region everytag             transparent start="[\[({]" end="[\])}]" contains=ALL

" Set the keyword characters

syn keyword bbmenuFuncc         contained exec include nop
syn keyword bbmenuLookc         contained style stylesdir 
syn keyword bbmenuBlocksc       contained submenu begin end
syn keyword bbmenuConfigc       conatined exit workspaces config reconfig restart

syn match bbmenuComment         "^#.*$"

syn region bbmenuBegin          contained start="\[begin\]" end="\[end\]" 
contains=bbmenuSubmenu,bbmenuCommand
syn region bbmenuSubmenu        contained start="\[submenu\]" end="\[end\]" 
contains=bbmenuCommand,bbmenuLabel,bbmenuString
syn region bbmenuCommand        contained start="\[" skip="\\[\[\](){}]" end="\]" 
contains=bbmenuFuncc,bbmenuLookc,bbmenuBlocksc,bbmenuConfigc
syn region bbmenuLabel          contained start="(" skip="\\[\[\](){}]" end=")"
syn region bbmenuString         contained start="{" skip="\\[\[\](){}]" end="}"

if !exists("did_bbmenu_syntax_inits")
  let did_bbmenu_syntax_inits = 1
  " The default methods for highlighting.  Can be overridden later
  hi link bbmenuFuncc           Function
  hi link bbmenuLookc           Keyword
  hi link bbmenuBlocksc         Delimiter
  hi link bbmenuConfigc         Statement

  hi link bbmenuComment         Comment
  hi link bbmenuCommand         Include
  hi link bbmenuLabel           Type
  hi link bbmenuString          String
  hi link bbmenuErr1            Error
endif

let b:current_syntax = "bbmenu"

Reply via email to