GitHub has made Markdown an essential for pretty much any project, and being a hopeless Vim addict I spend at least some of my time editing Markdown files in there.

For at least a year now I’ve been meaning to configure Vim to auto-wrap at 80 characters for these files, and only this week got round to googling it. First a Filetype for Markdown:

autocmd BufRead,BufNewFile *.md set filetype=Markdown

And then for this file type set the width to wrap at…

au Filetype Markdown setlocal wrap textwidth=80