[vim/vim] TOML (#7432)

13 views
Skip to first unread message

Steven Penny

unread,
Dec 6, 2020, 7:47:10 PM12/6/20
to vim/vim, Subscribed

It looks like TOML is not currently supported:

https://github.com/toml-lang/toml

as a workaround, I am changing this:

https://github.com/vim/vim/blob/7b130b9738c3d3975721ce9b84f91320e8d4857c/runtime/filetype.vim#L1981-L1982

to:

au BufNewFile,BufRead *.yaml,*.yml,*.toml		setf yaml


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Shougo

unread,
Dec 6, 2020, 7:49:12 PM12/6/20
to vim/vim, Subscribed

TOML is not yaml.

Steven Penny

unread,
Dec 6, 2020, 7:52:37 PM12/6/20
to vim/vim, Subscribed

Yeah I know that.

but YAML has the closest syntax. So until someone imports a TOML syntax file, its the best option.

James McCoy

unread,
Dec 6, 2020, 8:18:23 PM12/6/20
to vim/vim, Subscribed

You can use https://github.com/cespare/vim-toml/.

There's already discussion (although the maintainer has understandable reservations) about submitting the scripts to Vim -- cespare/vim-toml#36.

Christian Brabandt

unread,
Dec 7, 2020, 2:16:10 AM12/7/20
to vim/vim, Subscribed

so it looks like there is already discussion about this on the upstream repository. Until this is resolved, you can clone this repository. So I am closing this.

Christian Brabandt

unread,
Dec 7, 2020, 2:16:12 AM12/7/20
to vim/vim, Subscribed

Closed #7432.

Bram Moolenaar

unread,
Dec 7, 2020, 6:24:53 AM12/7/20
to vim/vim, Subscribed


> It looks like TOML is not currently supported:
>
> https://github.com/toml-lang/toml
>
> as a workaround, I am changing this:
>
> https://github.com/vim/vim/blob/7b130b9738c3d3975721ce9b84f91320e8d4857c/runtime/filetype.vim#L1981-L1982
>
> to:
>
> ~~~vim

> au BufNewFile,BufRead *.yaml,*.yml,*.toml setf yaml
> ~~~

For a temporary solution you better set the right filetype (probably
"toml"), and add a syntax file that loads the yaml syntax for now.
Then it's easier for a user to drop in another toml.vim in their own
.vim/syntax directory to overrule it.

--
ROBIN: (warily) And if you get a question wrong?
ARTHUR: You are cast into the Gorge of Eternal Peril.
ROBIN: Oh ... wacho!
"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 ///

Maxim Kim

unread,
Dec 7, 2020, 9:58:12 AM12/7/20
to vim_dev
> For a temporary solution you better set the right filetype (probably
>   "toml"), and add a syntax file that loads the yaml syntax for now.
>   Then it's easier for a user to drop in another toml.vim in their own
>   .vim/syntax directory to overrule it. 
 
I have my own toml syntax (ftdetect, ftplugin, syntax) https://github.com/habamax/.vim/tree/master/pack/habamax/start/vim-toml

This change wouldn't break it, right?


Reply all
Reply to author
Forward
0 new messages