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


About the author

Box UK

Box UK

Box UK's team of simply brilliant thinkers, consultants and application developers mastermind simply brilliant solutions to the world's toughest, performance-critical web and software assignments.

Related content

We're hiring. Let's talk. View available roles