Hi all
I have attached a first stab at a vim syntax highlighting file for 'crm
configure edit'
To activate this, I have added 'filetype plugin on' to my /root/.vimrc
then created /root/.vim/{ftdetect,ftplugin}/pcmk.vim
In /root/.vim/ftdetect/pcmk.vim I have the following content
au BufNewFile,BufRead /tmp/tmp* set filetype=pcmk
but there may be a better way to make this happen. /root/.vim/pcmk.vim
is the attached file.
Comments (not too nasty please!) welcome.
--
Voiceflex
Tel 0203 301 6000 | Fax 0203 310 6700
http://getsatisfaction.com/voiceflex
www.voiceflex.com
Information contained in this e-mail is intended for the use of the
addressee(s) only and is confidential. If you are not an addressee, note that
any disclosure, copying, distribution, or use of the contents of this message
is strictly prohibited. If you have received this e-mail in error, please
contact the firm at +44 (0) 20 3301 6000 or supp...@voiceflex.com. Any views
or opinions expressed in this message are those of the individual sender,
except where the sender specifically states them to be the views of Frontier
Systems Ltd. Frontier Systems Ltd does not accept legal responsibility for this
e-mail message due to the insecure nature of internet communications. Frontier
Systems, 9 Warwick Street, London W1B 5LY Registered in England and Wales, No.
03544845
" Vim syntax file
" Language: pcmk
" Filenames: *.pcmk
" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
syntax clear
elseif exists("b:current_syntax")
finish
endif
" setlocal iskeyword+=-
" Errors
syn match pcmkParErr ")"
syn match pcmkBrackErr "]"
syn match pcmkBraceErr "}"
" Enclosing delimiters
syn region pcmkEncl transparent matchgroup=pcmkParEncl start="("
matchgroup=pcmkParEncl end=")" contains=ALLBUT,pcmkParErr
syn region pcmkEncl transparent matchgroup=pcmkBrackEncl start="\["
matchgroup=pcmkBrackEncl end="\]" contains=ALLBUT,pcmkBrackErr
syn region pcmkEncl transparent matchgroup=pcmkBraceEncl start="{"
matchgroup=pcmkBraceEncl end="}" contains=ALLBUT,pcmkBraceErr
" Comments
syn region pcmkComment start="//" end="$" contains=pcmkComment,pcmkTodo
syn region pcmkComment start="/\*" end="\*/" contains=pcmkComment,pcmkTodo
syn keyword pcmkTodo contained TODO FIXME XXX
" Strings
syn region pcmkString start=+"+ skip=+\\\\\|\\"+ end=+"+
" General keywords
syn keyword pcmkKeyword node primitive property nextgroup=pcmkName skipwhite
syn keyword pcmkKey2 location nextgroup=pcmkResource skipwhite
syn keyword pcmkKey3 colocation order nextgroup=pcmkName3 skipwhite
syn match pcmkResource /\<\f\+\>/ nextgroup=pcmkName2 skipwhite
syn match pcmkName /\<\f\+\>/
syn match pcmkName2 /\<\f\+\>/ nextgroup=pcmkPrio skipwhite
syn match pcmkName3 /\<\f\+\>/ nextgroup=pcmkPrio skipwhite
syn match pcmkPrio /\<\w\+\>/
" Graph attributes
syn keyword pcmkType attributes params op meta
syn keyword pcmkTag monitor start stop
" Special chars
syn match pcmkKeyChar "="
syn match pcmkKeyChar ";"
syn match pcmkKeyChar "->"
" Identifier
syn match pcmkIdentifier /\<\w\+\>/
syn match pcmkKeyword "^ms\s*" nextgroup=pcmkName skipwhite
" Synchronization
syn sync minlines=50
syn sync maxlines=500
" Define the default highlighting.
" For version 5.7 and earlier: only when not done already
" For version 5.8 and later: only when an item doesn't have highlighting yet
if version >= 508 || !exists("did_pcmk_syntax_inits")
if version < 508
let did_pcmk_syntax_inits = 1
command -nargs=+ HiLink hi link <args>
else
command -nargs=+ HiLink hi def link <args>
endif
HiLink pcmkParErr Error
HiLink pcmkBraceErr Error
HiLink pcmkBrackErr Error
HiLink pcmkComment Comment
HiLink pcmkTodo Todo
HiLink pcmkParEncl Keyword
HiLink pcmkBrackEncl Keyword
HiLink pcmkBraceEncl Keyword
HiLink pcmkKeyword Keyword
HiLink pcmkKey2 Keyword
HiLink pcmkKey3 Keyword
HiLink pcmkType Keyword
HiLink pcmkKeyChar Keyword
HiLink pcmkString String
HiLink pcmkIdentifier Identifier
HiLink pcmkTag Tag
HiLink pcmkName Type
HiLink pcmkName2 Tag
HiLink pcmkName3 Type
HiLink pcmkResource Type
HiLink pcmkPrio Number
delcommand HiLink
endif
let b:current_syntax = "pcmk"
" vim: ts=8
_______________________________________________
Pacemaker mailing list: Pacemaker@oss.clusterlabs.org
http://oss.clusterlabs.org/mailman/listinfo/pacemaker
Project Home: http://www.clusterlabs.org
Getting started: http://www.clusterlabs.org/doc/Cluster_from_Scratch.pdf
Bugs: http://developerbugs.linux-foundation.org/enter_bug.cgi?product=Pacemaker