caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Vim syntax file for 3.12 features
@ 2011-06-05 16:52 Dario Teixeira
  2011-06-05 20:23 ` Yaron Minsky
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Dario Teixeira @ 2011-06-05 16:52 UTC (permalink / raw)
  To: caml-list

Hi,

Has someone tweaked Vim's syntax files for OCaml so that they support
3.12's first-class-modules?  (The syntax highlighting of any code using
this feature is just plain wrong at the moment).

On a related note, it's my understanding that a large percentage (most?)
of the OCaml community uses Emacs.  Without meaning to start an editor
flamewar, I would like to know the opinion of those who've edited OCaml
under both Emacs and Vim: is the former's support so much better that
it's worth the effort to learn Emacs?

Cheers,
Dario Teixeira



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Vim syntax file for 3.12 features
  2011-06-05 16:52 [Caml-list] Vim syntax file for 3.12 features Dario Teixeira
@ 2011-06-05 20:23 ` Yaron Minsky
  2011-06-07 14:29 ` Vincent Aravantinos
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Yaron Minsky @ 2011-06-05 20:23 UTC (permalink / raw)
  To: Dario Teixeira; +Cc: caml-list

[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]

Although I'm an emacs user myself, a large fraction of the Jane Street folk
hack in vim, and seem quite content.

y

On Sun, Jun 5, 2011 at 12:52 PM, Dario Teixeira <darioteixeira@yahoo.com>wrote:

> Hi,
>
> Has someone tweaked Vim's syntax files for OCaml so that they support
> 3.12's first-class-modules?  (The syntax highlighting of any code using
> this feature is just plain wrong at the moment).
>
> On a related note, it's my understanding that a large percentage (most?)
> of the OCaml community uses Emacs.  Without meaning to start an editor
> flamewar, I would like to know the opinion of those who've edited OCaml
> under both Emacs and Vim: is the former's support so much better that
> it's worth the effort to learn Emacs?
>
> Cheers,
> Dario Teixeira
>
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>

[-- Attachment #2: Type: text/html, Size: 1625 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Vim syntax file for 3.12 features
  2011-06-05 16:52 [Caml-list] Vim syntax file for 3.12 features 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
  3 siblings, 0 replies; 7+ messages in thread
From: Vincent Aravantinos @ 2011-06-07 14:29 UTC (permalink / raw)
  To: Dario Teixeira; +Cc: caml-list

Hi Dario,

Le 5 juin 11 à 18:52, Dario Teixeira a écrit :

> Hi,
>
> Has someone tweaked Vim's syntax files for OCaml so that they support
> 3.12's first-class-modules?  (The syntax highlighting of any code  
> using
> this feature is just plain wrong at the moment).

I'm planning to implement it but not so soon.
Unless someone (maybe you? ;) ) does it in the meantime...

V.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Vim syntax file for 3.12 features
  2011-06-05 16:52 [Caml-list] Vim syntax file for 3.12 features 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
  3 siblings, 0 replies; 7+ messages in thread
From: Raphael Proust @ 2011-06-07 17:02 UTC (permalink / raw)
  To: caml-list; +Cc: Dario Teixeira

Le dimanche 05 juin 2011 18:52:08, Dario Teixeira a écrit :
> Has someone tweaked Vim's syntax files for OCaml so that they support
> 3.12's first-class-modules?  (The syntax highlighting of any code using
> this feature is just plain wrong at the moment).

I started tweaking the ocaml.vim files to add support for the Lwt syntax
extension. I haven't fixed the first class module problems yet, but I plan to do
it eventually.

Cheers
-- 
______________
Raphaël Proust


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Vim syntax file for 3.12 features
  2011-06-05 16:52 [Caml-list] Vim syntax file for 3.12 features Dario Teixeira
                   ` (2 preceding siblings ...)
  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>
  3 siblings, 2 replies; 7+ messages in thread
From: Dario Teixeira @ 2011-06-07 18:57 UTC (permalink / raw)
  To: caml-list

Hi,

Thank you all for your input.  Judging from the responses, I gather that
Emacs has better OCaml support than Vim, though the difference is not so
overwhelming and Emacs is not without some drawbacks itself.  I guess I'll
just have to try out Emacs+Tuareg mode and see for myself -- perhaps even
putting to some immediate use the Tuareg section of those brand new OCamlPro
Cheat Sheets...

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?

Cheers,
Dario

[1] http://code.google.com/p/vim/source/browse/runtime/syntax/ocaml.vim



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Caml-list] Vim syntax file for 3.12 features
  2011-06-07 18:57 ` Dario Teixeira
@ 2011-06-07 19:39   ` Vincent Aravantinos
       [not found]   ` <BANLkTimQzpFtCkHa6Byu6t5DFhai6D4Hvw@mail.gmail.com>
  1 sibling, 0 replies; 7+ messages in thread
From: Vincent Aravantinos @ 2011-06-07 19:39 UTC (permalink / raw)
  To: Dario Teixeira; +Cc: caml-list


Le 7 juin 11 à 20:57, Dario Teixeira a écrit :

> 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)

You can do it. The main matter with vim script language is generally not
whether you can solve a pb or not, but whether the complexity of the
ugly solution you will find will be manageable or not (and it will be
ugly, believe me).

V.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Fwd: [Caml-list] Vim syntax file for 3.12 features
       [not found]   ` <BANLkTimQzpFtCkHa6Byu6t5DFhai6D4Hvw@mail.gmail.com>
@ 2011-06-08  9:55     ` Raphael Proust
  0 siblings, 0 replies; 7+ messages in thread
From: Raphael Proust @ 2011-06-08  9:55 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-06-08  9:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-05 16:52 [Caml-list] Vim syntax file for 3.12 features 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     ` Fwd: " Raphael Proust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).