By default, using gq
with a movement command hard-wraps the text described by the movement command to 79 columns. (I'm relatively new to vi
/vim
so I don't know the correct terminology.) How can I configure that column count so that instead it wraps at a different number of columns?
For example, suppose I have this text:
This is text for illustration.
I'd like to be able to configure the wrap column to 29 so that if my cursor is in the line and I run gqip
it is transformed to:
This is text for
illustration.
I'm using gVim on Ubuntu GNOME 17.04, if that makes a difference.
EDIT: I'm looking for a way to manually wrap certain sections of text to the given line length without affecting any others, because there are some cases where I'm OK with going past the limit. To expand on the previous example, if my document looks like this:
This is text for illustration.
This is some other text for illustration.
And I run gqip
with my cursor in the first line, I'd like to get:
This is text for
illustration.
This is some other text for illustration.
Then if I start typing on a new line below that, I'd like that line to similarly be unaffected by the limit.
My use case is in writing LaTeX documents: I'd like to be able to wrap paragraphs of prose to a certain number of columns on demand, but in certain cases where I'm writing long equations, or tables, I want those lines to stay longer than the limit.