It is important to realize that this "default" only applies to the gq
and gw
commands and auto-format as described in that section. The default textwidth
is 0. Furthermore, :right
and :center
default to 80, not 79.
As for why 79 was chosen, it cannot be a direct hold-over from vi since gq
, gw
, and auto-format do not exist in vi. This is mostly speculation, but I believe the 79 default for auto-format was chosen for consistency with vi's existing auto-wrapping. That this applies for gq
and gw
is a side-effect; one might expect 80 would have been chosen otherwise.
In vi (and in vim if textwidth=0
) text starts auto-wrapping at the window width minus wrapmargin
. However, if wrapmargin=0
, no auto-wrapping will take place. This means that if you were using an ADM-3A with an 80 character limit, with wrapmargin=1
, the maximum width with auto-wrapping is 79. An upside to this behavior is that there is a place for the cursor to live while waiting to see what the next character is going to be before deciding where to wrap. Of course, vi and vim could put the cursor on the next line (as observed when typing a very long word) but leaving an extra column is a bit nicer.
80
is a pretty arbitrary "standard" to begin with so… why not79
? Now, wrapping lines at79
in a80
columns-wide terminal gives a bit more room to the right and may improve legibility. github.com/vim/vim/blob/…80
columns-wide terminal the last column was reserved for the wrapping symbol? Still, if you have line numbers on, then they will definitely take more than just one column. So, I'm still puzzled. Moreover, from the code you linked, is79
the max value it can be used? Maybe I did not understand what I read.textwidth
and be done with.tw=79
instead oftw=80
because displaying a line 80 characters long on an 80 columns terminal prints an extra newline.