Vim: Linebreak at 80 characters

Step-by-Step descriptions of how to do things.

Vim: Linebreak at 80 characters

Postby ^rooker » Mon Aug 06, 2018 10:52 pm

If you want to quickly format a plain text into a certain-character-width, here's how to do it in Vim:

Set the text-width to 80 characters:
Code: Select all
:set tw=80

Then the following options are at your service:
Code: Select all
gq{motion} % format the line that {motion} moves over
{Visual}gq % format the visually selected area
gqq        % format the current line


Thanks to an answer from "he_the_great" on Stackoverflow.
  • 0

Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
User avatar
Site Admin
Posts: 1444
Joined: Fri Aug 29, 2003 8:39 pm
Reputation: 0

Return to HowTo's

Who is online

Users browsing this forum: No registered users and 1 guest

Who is online over last 24 hours

Users browsed this forum in the last 24 hours: No registered users and 10 guests

Reputation System ©'