3 ms·
auto-fill mode doesn't reflow paragraphs at will, it just inserts a line break when you go over the limit. For instance, if you're editing a document and write
by compsciphd 10y ago
auto-fill mode doesn't reflow paragraphs at will, it just inserts a line break when you go over the limit.
For instance, if you're editing a document and write a long sentence, that spreads over 3-4 lines. You then take a scalpel to it to make it more concise, so that it fits on a line or 2. Emacs won't reflow it automatically, you can manually get it to reflow (M-q by default), but its not the behaviors you expect from say a word processing program. Same exists if you insert new text.
TLDR: all auto-fill mode does is insert new lines when you reach the line length limit.
- groovy2shoes 10y agoPardon me for piggy-backing on your comment, but the Vim equivalent of Emacs's auto-fill mode is to `:set textwidth=74 wrap linebreak` (where 74 here is the column at which to wrap, and `linebreak` tells Vim to break at some character specified in `breakat`, which is set to a useful default consisting of whitespace and various punctuation). The default behavior is the same as @compsciphd describes for Emacs: it won't reflow automatically during editing, however, the sequence `gqap` in command mode will reflow the current paragraph (`gq` is a command to format text, and it is followed by a motion to specify the text to format: in this case `ap` is the motion for "a paragraph", i.e., the paragraph which currently contains the cursor). Vim also has an auto-format feature, which can be enabled with `:set formatoptions+=a` and will make paragraph editing behave a bit more like, say, a word processing program, but the Vim help file cautions that formatting long paragraphs or paragraphs with complicated indentation can get slow. I haven't really used the auto-format feature myself, so I can't comment on how slow it actually seems to be in practice.