On 4/19/07, Jonathan Smith <[EMAIL PROTECTED]> wrote:
Bram Moolenaar wrote:
> "recipe" is not a good filetype name. Is there anything against using > "conary"?
Well, the files are called recipes. In the same way that you wouldn't call a spec file "rpm", you wouldn't call a recipe "conary". Conary has other file types which it uses, which vim should not be able to edit (changesets, the equivalent of an RPM).
Well, the rpm spec file-type has been with us a long time, well before we knew better. Try to give your file-type an as specific name as possible. You will not be getting the name "recipe"; it's way too generic in this day and age. Go with "conrecipe" or something similar. Remember: Bram has his own build system, called Aap, which also uses recipes. Also, if Vim will never edit a (Conary) changeset, then why will we have to worry about a name-clash between different conary file-types?
" Vim syntax file " Language: Conary Recipe " Maintainer: rPath Inc <http://www.rpath.com> " Updated: 2007-04-18 "
Nitpick: remove the empty comment.
" 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
Just do if exists("b:current_syntax") finish endif No one will be using your syntax definition with vim 5 anyway. Let's keep new files clean from (now) unnecessary cruft.
syn keyword conaryUseFlag contained pcre tcpwrappers gcj gnat selinux pam syn keyword conaryUseFlag contained bootstrap python perl syn keyword conaryUseFlag contained readline gdbm emacs krb builddocs syn keyword conaryUseFlag contained alternatives tcl tk X gtk gnome qt syn keyword conaryUseFlag contained xfce gd ldap sasl pie desktop ssl kde syn keyword conaryUseFlag contained slang netpbm nptl ipv6 buildtests syn keyword conaryUseFlag contained ntpl xen dom0 domU syn match conaryUse "Use\.[a-z0-9.]*" contains=conaryUseFlag
Sure that * shouldn't be a \+? And can you have a sequence of dots, as in Use...? Also, you're not using syntax case ignore, so I don't quite see how [a-z0-9.] will match "X" or "domU". A better way of doing this is to do (substitute \w with whatever pattern your parser actually allows) syn match conaryUse \ "Use\.\w\+" \ nextgroup=conaryUseFlag syn keyword conaryUseFlag \ contained \ nextgroup=conaryUseFlagSeparator \ pcre \ tcpwrappers \ ... syn match conaryUseFlagSeparator \ contained \ nextgroup=conaryUseFlag \ '\.'
"syn match conaryR "r\.\w*" contains=conaryFunction
Leftover?
if version >= 508 || !exists("did_python_syn_inits") if version <= 508 let did_python_syn_inits = 1 command -nargs=+ HiLink hi link <args> else command -nargs=+ HiLink hi def link <args> endif
Just skip this. No one will be using your syntax definition with Vim 5.
"HiLink pythonStatement Statement "HiLink pythonFunction Function "HiLink pythonConditional Conditional "HiLink pythonRepeat Repeat "HiLink pythonString String "HiLink pythonRawString String "HiLink pythonEscape Special "HiLink pythonOperator Operator "HiLink pythonPreCondit PreCondit "HiLink pythonComment Comment "HiLink pythonTodo Todo
?
" vim: ts=8
This is the default setting. nikolai