From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p589tHQa022145 for ; Wed, 8 Jun 2011 11:55:17 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlADAIxG703RVdy0mGdsb2JhbAA9AQMShEqTBzKOJAgUAQEBAQEICQ0HFCWrT4trPIJAhFc5iGMBAQMGgSWDboEKBJEbiQWCSjyDQg X-IronPort-AV: E=Sophos;i="4.65,337,1304287200"; d="scan'208";a="110670328" Received: from mail-vx0-f180.google.com ([209.85.220.180]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 08 Jun 2011 11:55:11 +0200 Received: by vxk12 with SMTP id 12so380017vxk.39 for ; Wed, 08 Jun 2011 02:55:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=UvaA1sb2sSQc7efRdC2NBItv0iZZJ9PetL4rejSRg0o=; b=fA479Z9gz4Dd/ta7q2Ih2aN7VC5JUZFELJGp57e5UY6akygesacqd01piuXRJl/el7 17lf/H5/Fi0WY/+SpIhGVgFAQ+2g+rBoPZQ7UPpTFmlDN0k6ipCQZbJowi6kWJ3oih5c 1s9cSC8g2zIMKoA88Y+cqox0cEjU+get0xJK4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=gCSCiWuUUcH8k50icIp8AQdSeF6OcIOuqHjDkDnjfnWWydm1qzLnUwNPktiXWjrkff OnIBwh+zcCisi+5kPVr35k/IKxJqPewfNg8WC+yUdKJ2CbDNglEQxd/7I7ePf4uLZ4Dh idpS62oaGPqeELlm0WgA7WB0ehfxvD/9QrZH0= MIME-Version: 1.0 Received: by 10.52.174.176 with SMTP id bt16mr944386vdc.282.1307526910165; Wed, 08 Jun 2011 02:55:10 -0700 (PDT) Received: by 10.52.162.167 with HTTP; Wed, 8 Jun 2011 02:55:10 -0700 (PDT) In-Reply-To: References: <429462.47024.qm@web111513.mail.gq1.yahoo.com> <715947.44527.qm@web111506.mail.gq1.yahoo.com> Date: Wed, 8 Jun 2011 11:55:10 +0200 Message-ID: From: Raphael Proust To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p589tHQa022145 Subject: Fwd: [Caml-list] Vim syntax file for 3.12 features Accidentally went off-list… ---------- Forwarded message ---------- From: Raphael Proust Date: Wed, Jun 8, 2011 at 11:52 AM Subject: Re: [Caml-list] Vim syntax file for 3.12 features To: Dario Teixeira On Tue, Jun 7, 2011 at 8:57 PM, Dario Teixeira wrote: > Raphaël: Lwt support would be great.  More so if 3.12 features are also > supported.  I'm not familiar with the capabilities of Vim's syntax files: > can the same definition file [1] support both vanilla OCaml code and Lwt > extensions (for example by specifying that if the file extension is .mlw > then an extra section applies), or would you need to fork the syntax file > if you want to support vanilla alongside Lwtfied OCaml? > > [1] http://code.google.com/p/vim/source/browse/runtime/syntax/ocaml.vim It is possible to support both vanilla and modified syntax in the same file. The revised syntax is supported in ocaml.vim using the `ocaml_revised` variable: ~~~~ if exists("ocaml_revised")  syn keyword  ocamlBoolean  True False else  syn keyword  ocamlBoolean  true false endif ~~~~ As you pointed out, it is also possible to fork the syntax file and have a different filetype. I started this way. You can use the https://github.com/raphael-proust/ocaml_lwt.vim repository and edit the `ftdetect/ocaml_lwt.vim` to trigger the fitetype only for .mlw (and .eliom?) files: `au! Bufread,BufNewFile *.mlw    set filetype=ocaml_lwt` -- _______ Raphael