Change *.md to ft=markdown instead of modula2?

49 views
Skip to first unread message

David Barnett

unread,
Oct 2, 2014, 8:40:34 PM10/2/14
to vim...@googlegroups.com
filetype.vim currently assigns filetype=modula2 to any *.md buffer unless it's called README.md. There may be programmers out there who use modula2, but I think it's pretty uncontroversial to say the vast majority of *.md files edited in vim are markdown, not modula2. Could we change the default?

If it's possible to create a content-based detection rule for modula2, that would be fine, as long as it's precise and empty files are configured as markdown. Of course, any modula2 programmers annoyed by the change could create their own ftdetect rules to override the settings, same as markdown users have had to do.

David

Jacky Alciné

unread,
Oct 2, 2014, 10:07:19 PM10/2/14
to vim...@googlegroups.com

+1 on this. I've made it a patch.

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christian Brabandt

unread,
Oct 3, 2014, 7:37:57 AM10/3/14
to vim...@googlegroups.com
Hi Jacky!
(please do not top poste)

On Do, 02 Okt 2014, Jacky Alciné wrote:

> +1 on this. I've made it a patch.

Where is it? You should probably post it at vim_dev.


Best,
Christian
--
Das Fernsehen macht die Klugen klüger und die Dummen dümmer.
-- Marcel Reich-Ranicky

Bram Moolenaar

unread,
Oct 3, 2014, 11:44:26 AM10/3/14
to David Barnett, vim...@googlegroups.com
I recommend using .mkd for markdown files. There appears to be a wide
variety of file name extensions for Markdown. Using .mkd is the most
specific of the shorter ones, therefore it's the best choice.

Modula2 isn't used much these days, I wonder if someone knows if it can
be recognized by the first few lines.

--
hundred-and-one symptoms of being an internet addict:
218. Your spouse hands you a gift wrapped magnet with your PC's name
on it and you accuse him or her of genocide.

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

LCD 47

unread,
Oct 3, 2014, 12:00:45 PM10/3/14
to vim...@googlegroups.com
On 3 October 2014, Bram Moolenaar <Br...@moolenaar.net> wrote:
>
> David Barnett wrote:
>
> > filetype.vim currently assigns filetype=modula2 to any *.md buffer
> > unless it's called README.md. There may be programmers out there
> > who use modula2, but I think it's pretty uncontroversial to say
> > the vast majority of *.md files edited in vim are markdown, not
> > modula2. Could we change the default?
> >
> > If it's possible to create a content-based detection rule for
> > modula2, that would be fine, as long as it's precise and empty files
> > are configured as markdown. Of course, any modula2 programmers
> > annoyed by the change could create their own ftdetect rules to
> > override the settings, same as markdown users have had to do.
>
> I recommend using .mkd for markdown files. There appears to be a wide
> variety of file name extensions for Markdown. Using .mkd is the most
> specific of the shorter ones, therefore it's the best choice.

Sure, but that isn't useful when opening files created by other
people. :) GitHub made popular the use of *.md for Markdown, and I don't
think that particular trend will reverse any time soon.

> Modula2 isn't used much these days, I wonder if someone knows if it
> can be recognized by the first few lines.

Modula-2 is somewhat similar to Pascal, thus the answer is probably
no. IIRC the most used extensions for Modula-2 were *.mod and *.m2
anyway.

/lcd

David Barnett

unread,
Oct 6, 2014, 9:08:31 PM10/6/14
to vim...@googlegroups.com
Nice, so even among Modula-2 programmers this should be a pretty uncontroversial change. Looks like a simple matter of changing "README.md" to "*.md". Can we get that into the next vim release?

David

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/njgT_zwxBjU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.

glts

unread,
Oct 7, 2014, 1:44:04 PM10/7/14
to vim...@googlegroups.com
On Friday, October 3, 2014 2:40:34 AM UTC+2, David Barnett wrote:
> filetype.vim currently assigns filetype=modula2 to any *.md buffer unless it's called README.md. There may be programmers out there who use modula2, but I think it's pretty uncontroversial to say the vast majority of *.md files edited in vim are markdown, not modula2. Could we change the default?
>
> If it's possible to create a content-based detection rule for modula2, that would be fine, as long as it's precise and empty files are configured as markdown. Of course, any modula2 programmers annoyed by the change could create their own ftdetect rules to override the settings, same as markdown users have had to do.

+1

I would welcome this change. Most Markdown files I've come across have
had the .md or .markdown (rarely .mdown) file extension. It would be
nice to have .md work out of the box.


--
David

Reply all
Reply to author
Forward
0 new messages