help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

convert vim syntax file into emacs highlight patterns


From: Holger . Bauer
Subject: convert vim syntax file into emacs highlight patterns
Date: 30 Sep 2002 18:35:21 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.5 (bok choi)

How can I convert a vim syntax file into an appropriate emacs lisp
file using the same regular expressions for highlighting?
Anybody has a converter for this or an example of a really simple
highlighting pattern mode (no other things, just highlighting)?

- Holger -


Example: 

syn clear
" Ignore case
syn case ignore
"-------------------------------------------------------------------------
" header is in different color
syn match   foodef     "^\*.*"    contains=foovar,foooptvar
syn match   fooopt     "^\*\$.*"  contains=foovar
syn match   fooHead    "^\*\*.*"
syn match   fooHead    "^\*\s\+[a-zA-Z].*"
syn match   foooptvar  "<\$[A-Z]\+>"  contained
syn match   fooComment   "^[\!\#].*" contains=fooTodo
syn match   foodef     "\s\+\/.*"  contains=fooTodo
syn match   fooTodo    "\s[xyXY]\+\.*[yxXY]*"
syn keyword fooTodo    TODO FIXME XXX contained
syn match   fooTodo    "???"
"|"
"-------------------------------------------------------------------------
"  TODO
if !exists("did_foo_syntax_inits")
  let did_foo_syntax_inits = 1
hi  fooHead    ctermfg=red           guifg=red
hi  foovar     ctermfg=red           guifg=red
hi  fooopt     ctermfg=darkgreen     guifg=darkgreen
hi  foooptvar  ctermfg=darkgreen     guifg=darkgreen
hi  foodef     ctermfg=blue          guifg=blue
hi  fooComment ctermfg=lightgray     guibg=lightgray
hi link fooTodo   Todo
endif
let b:current_syntax = "foo"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]