Larry Alkoff wrote:
I frequently copy and paste text from web pages and would like to break
lines at (say) 72 without splitting words.
My preference is to do this either on the command line
or by
ESC :command
I've read the post in the thread "auto-wrapping text" by A.J.Mechelynck
in which he suggests gggqG
but I can't see how to do this from either command line or EX command.
vim wrapmargin=40 testfile
does not work.
The best thing I've seen so far is, in vi
:set wm=0 or :set wm=5
both of which cause vi to wrap lines at 0 or 5 characters from the
_right_ margin which comes to a maximum line of 62 which is a little small.
I've also tried
set tw=nn
which doesn't seem to do anything.
I can't seem to find the appropriate command either on line of using my
favorite reference O'Reilly's "VI Editor Pocket Reference".
Could someone help me?
Larry
Following up on the above post I have found that the command
:set textwidth=72
does what I want.
Is there any way I can do this when I invoke vim for the purpose of
pasting in text from websites?
My present .vimrc contains the lines:
autocmd FileType text setlocal textwidth=78
which doesn't appear to work when pasting text.
Maybe the line should be a simple
textwidth=72 ??
Looking at the book "VI Improved Vim"
it appears that I could have a special .vimrc called .vimrcp
which would be my normal .vimrc with the line above changed to
textwidth=72
and vim would be invoked with the alias
alias vimpaste='-u .vimrcp'
I'll try this tomorrow.
Larry
--
Larry Alkoff N2LA - Austin TX
Using Thunderbird on Linux