Saturday, May 26, 2012

Re: Folding on markdown headers

On Sat, May 26, 2012 at 08:38:28PM EDT, Eric Weir wrote:
>
> On May 26, 2012, at 6:32 PM, Chris Jones wrote:

[..]

> > As soon as I issued a ':w /tmp/sample.mdown' to write the [No Name]
> > buffer to disk , the markdown was highlighted.

> Thanks, Chris. I did same with an ".mkd" extent and got the same
> result. I'm embarrassed to say this, but I think all this "sturm und
> drang" is going to turn out to have been occasioned by the fact that
> I mistakenly believed that ".md" was a markdown extent.

Not to worry.. That's one area of Vim I don't understand very well..
An opportunity to learn something..

> > I would avoid '*.mmd' & '*.md' (not in the above list). Worse, per
> > filetype.vim, '*.md' is something else: a modula2 file extension.

> No problem with ".md", but ".mmd" is the extent used by multimarkdown,
> an extension of markdown that adds some additional features, e.g.,
> footnotes. It is used by Scrivener to convert Scrivener documents to
> LaTeX. Without the ".mmd" extent multimarkdown will not compile the
> file.

Ah, for syntax highlighting and presumably folding to work, you would
need to create a custom autocommand (same as the one in filetype.vim)
for this file extension to be recognized and stick it either in your
.vimrc or possibly in your ftplugin/ or your after/ftplugin directory
(untested).

[..]

> Safe to assume the script is loaded since I'm getting folding on
> recognized markdown files?

Absolutely.

> > Then run ':verbose set ft' and ':verbose set syntax' to see if they
> > are set to 'markdown' and then ':verbose set fdm'.. should say
> > 'expr'.
>
> All results are positive.
>
> I think this solves the problem. My apologies to everyone who was
> scratching their heads on this one when all along it was a stupid
> mistaken assumption on my part.

Where I'm concerned, no need to apologize.. thanks for the workout.. ;-)

> Not that it wasn't educational, though. So also thanks for that.

Talking of educational.. in reference to what you wrote elsewhere
regarding Vim help, I thought I might mention that there are two
distinct parts to Vim's help: the 'user manual' and the 'reference
manual'.

Maybe the following illustrates the difference between the two:

| :h cpo
| :h user-manual

The user manual provides structured overviews of pretty much every area
of Vim without going into too much detail. Studying at my own pace, one
chapter at a time helped find my bearings. Mind you, I mean studying..
not printing it and just reading through it.. splitting the screen and
practising in a scratch buffer until you really know what's there. The
good thing is there are links to the reference manual whenever you feel
like digging..

Once you've worked through that, you will be able to find what you're
looking for in the reference manual much more easily and what you find
there will make better sense.

CJ

--
Mooo Canada!!!!

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

No comments: