I noticed that gq does not work when I insert a long string. For example, with textwidth=72 and formatoptions=tcroqbnl , formatoptions=tcroqbnl refuses formatoptions=tcroqbnl this (in insert mode, I inserted the entire contents of the label, and then exited insert mode using ESC ):
<label for="contact_reason_1">To get assistance with or to confirm a tire replacement recommendation</label>
If I add a line break (for example, after the "to"), it will be wrapped. The funny thing is that if I join the line again, she will gladly wrap it again. So VIM, it seems, somehow recalls: "Oh, this is one paste, do not wrap it."
How to disable this feature? I would like gq to always work in command mode. formatoptions l of formatoptions did not seem to help (and should not, this is not insert mode).
lightening
Yes, I use a motion command, specifically gq <Right> . formatexpr and formatprog both not installed. If that matters, it is in gvim for Debian GNU / Linux, vim version 7.2p284.
Playback Actions
- Call gvim in an open file.
- Press i to enter insert mode, then enter
This is a long line. A long line. But not wrappable yet. Or yet. Soon. This is a long line. A long line. But not wrappable yet. Or yet. Soon. This is a long line. A long line. But not wrappable yet. Or yet. Soon. - Press ESC , then I. Enter
Now putting text in front of the long line. note: there is a space after the last period, so it cannot display it, except when this note is here. FUN. - Press ESC , then A. Like
And some after. note: space before A, same problem SO. - Press ESC one last time. Now try gq <Left> , note that only wraps
And some after. ; I can't get vim to wrap the rest of the line (without going into insert mode and without doing a line break manually, then this works).
Correction of this condition is doable; adding a new line after βnowβ, and then clicking the βCancelβ button again leads to line breaks. WTF.
vim paste wrap word-wrap
derobert Dec 09 '09 at 13:50 2009-12-09 13:50
source share