Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
35 lines (24 sloc) 434 Bytes

Wrap Text in Vim

You have an existing block of text or code in Vim. You want to re-format it to wrap to 80 characters.

:set textwidth=80

Select the lines of text you want to re-format:


Reformat it:


Learn more:

:h gq

If want the 80 character setting to apply automatically for file types like Markdown, add this to your vimrc:

au BufRead,BufNewFile *.md setlocal textwidth=80
You can’t perform that action at this time.