31.16 vi Macro for Splitting Long LinesWhen you add text to the start of a line and make the line longer than your screen's width, vi won't break ("wrap") the line unless your cursor crosses the wrapmargin point near the right-hand edge of the screen. You can get lines that are too long.
map K 78^V|lBhr^M map K 078lF r^M
The first macro doesn't seem to work on some versions of
vi
.
It's the better one though, because it uses the The second macro counts TABs as single characters, but it works on every version of vi I've tried. It moves to the left edge, then to the 79th character, then back to the previous space. Finally, it replaces that space with a carriage return.
You might try adding a
That will break the current line at the 72nd column or before, though it also
might change the spacing after periods ( - |
|