From: Raphael Proust <raphlalou@gmail.com>
To: caml-list@yquem.inria.fr
Subject: Fwd: [Caml-list] Vim syntax file for 3.12 features
Date: Wed, 8 Jun 2011 11:55:10 +0200 [thread overview]
Message-ID: <BANLkTinyFPfMVBiG4SJmMDgPAO0Lz9EX6Q@mail.gmail.com> (raw)
In-Reply-To: <BANLkTimQzpFtCkHa6Byu6t5DFhai6D4Hvw@mail.gmail.com>
Accidentally went off-list…
---------- Forwarded message ----------
From: Raphael Proust <raphlalou@gmail.com>
Date: Wed, Jun 8, 2011 at 11:52 AM
Subject: Re: [Caml-list] Vim syntax file for 3.12 features
To: Dario Teixeira <darioteixeira@yahoo.com>
On Tue, Jun 7, 2011 at 8:57 PM, Dario Teixeira <darioteixeira@yahoo.com> 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
prev parent reply other threads:[~2011-06-08 9:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-05 16:52 Dario Teixeira
2011-06-05 20:23 ` Yaron Minsky
2011-06-07 14:29 ` Vincent Aravantinos
2011-06-07 17:02 ` Raphael Proust
2011-06-07 18:57 ` Dario Teixeira
2011-06-07 19:39 ` Vincent Aravantinos
[not found] ` <BANLkTimQzpFtCkHa6Byu6t5DFhai6D4Hvw@mail.gmail.com>
2011-06-08 9:55 ` Raphael Proust [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=BANLkTinyFPfMVBiG4SJmMDgPAO0Lz9EX6Q@mail.gmail.com \
--to=raphlalou@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox