Haskell related syntax files.

9 views
Skip to first unread message

co...@coot.me

unread,
Nov 21, 2020, 7:24:57 AM11/21/20
to vim...@vim.org
Hi Bram,

I attach updated cabal syntax file.

I would also include support for two additional filetypes:

* cabal config files, recognized by:
```
au BufRead,BufNewFile $HOME/.cabal/config setf cabalconfig
au BufRead,BufNewFile cabal.config setf cabalconfig
```
* cabal project files, recognized by:
```
au BufRead,BufNewFile cabal.project setf cabalproject
au BufRead,BufNewFile cabal.project.* setf cabalproject
```

Haskell is also using `.hsc` extension, which is already assigned to `hamster` file type. Is there a mechanism which allows to resolve such conflicts. If not we could add a passage to the haskell documentation in `syntax.txt` file.


Best regards,
Marcin Szamotulski

cabal.vim
cabalconfig.vim
cabalproject.vim
signature.asc

Bram Moolenaar

unread,
Nov 21, 2020, 9:57:16 AM11/21/20
to vim...@googlegroups.com, co...@coot.me, vim...@vim.org

Marcin Szamotulski wrote:

> Hi Bram,
>
> I attach updated cabal syntax file.

Thanks.

The header of cabalconfig.vim says "Cabal Project".

> I would also include support for two additional filetypes:
>
> * cabal config files, recognized by:
> ```
> au BufRead,BufNewFile $HOME/.cabal/config setf cabalconfig
> au BufRead,BufNewFile cabal.config setf cabalconfig
> ```
> * cabal project files, recognized by:
> ```
> au BufRead,BufNewFile cabal.project setf cabalproject
> au BufRead,BufNewFile cabal.project.* setf cabalproject
> ```

Please suggest a patch for filetype.vim, and also add a test line in
src/testdir/test_filetype.vim

> Haskell is also using `.hsc` extension, which is already assigned to
> `hamster` file type. Is there a mechanism which allows to resolve
> such conflicts. If not we could add a passage to the haskell
> documentation in `syntax.txt` file.

You can inspect the first few lines of the file, if that helps to
recognize the filetype. If not, then the user has to specify it. You
can check filetype.vim for examples.

--
FIRST HEAD: All right! All right! We'll kill him first and then have tea and
biscuits.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

co...@coot.me

unread,
Nov 21, 2020, 1:28:15 PM11/21/20
to Bram Moolenaar, vim...@googlegroups.com, vim...@vim.org
Hi Bram,

I opened a PR

https://github.com/vim/vim/pull/7339
which updates `filetype.vim` and adds `syntax/cabalconfig.vim` and `syntax/cabalproject.vim` files.

The updated `syntax/cabal.vim` file is not included in that PR.

Best regards,
Marcin


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, November 21st, 2020 at 15:57, Bram Moolenaar <Br...@moolenaar.net> wrote:

> Marcin Szamotulski wrote:
>

> > Hi Bram,
> >

> > I attach updated cabal syntax file.
>

> Thanks.
>

> The header of cabalconfig.vim says "Cabal Project".
>

> > I would also include support for two additional filetypes:
> >

> > - cabal config files, recognized by:
> >

> > au BufRead,BufNewFile $HOME/.cabal/config setf cabalconfig
> > au BufRead,BufNewFile cabal.config setf cabalconfig
> >

> >

> > - cabal project files, recognized by:
> >

> > au BufRead,BufNewFile cabal.project setf cabalproject
> > au BufRead,BufNewFile cabal.project.* setf cabalproject
> >

>

> Please suggest a patch for filetype.vim, and also add a test line in
>

> src/testdir/test_filetype.vim
>

> > Haskell is also using `.hsc` extension, which is already assigned to
> >

> > `hamster` file type. Is there a mechanism which allows to resolve
> >

> > such conflicts. If not we could add a passage to the haskell
> >

> > documentation in `syntax.txt` file.
>

> You can inspect the first few lines of the file, if that helps to
>

> recognize the filetype. If not, then the user has to specify it. You
>

> can check filetype.vim for examples.
>

> --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
signature.asc
Reply all
Reply to author
Forward
0 new messages