Enabling markdown highlighting in Vim

About the native syntax highlight for markdown I think it only works for files with the extension .markdown by default.
I was having problems with markdown syntax highlight for my .md files.
I tried:

:set syntax=markdown

And it worked.
So i included the following line in my .vimrc:

au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown

Now my vim have syntax highlight for my .md files.

BufFilePre is needed for :sav

Leave a Comment