Detect Markdown files in vim

Quick tip which force vim to recognize .md files as Markdown formatted files:

  • create, if not exists, the needed directory
    mkdir -p ~/.vim/ftdetect/
    
  • create the file ~/.vim/ftdetect/markdown.vim with this content
    autocmd BufNewFile,BufRead *.md,*.mkdn,*.markdown :set filetype=markdown
    

Done.