Files
lk/writing/vim/linewrap.md
2025-11-06 03:36:18 +01:00

744 B

title, tags, requires
title tags requires
vim windows
vim
format
linewrap
vim basics

Wrap lines in a file to 80 characters with gqG.

Take this markdown file:

This is a looooooooooooooooooooooooong line, and reeeeeeeeeeeeeeding it can be a paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiiiiiiiiiiiiin in the aaaaaaaaaaaaaaaaaaaaaaaarse.

Reformat the line to the proper text width by pressing gqw. The output looks like this:

This is a looooooooooooooooooooooooong line, and reeeeeeeeeeeeeeding it can be
a paaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaiiiiiiiiiiiiin in the
aaaaaaaaaaaaaaaaaaaaaaaarse.

This works with chunks of text in visual mode.

Change what width the text should be:

:set textwidth=100