[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sup-talk] vim text wrapping



* On Thu Mar 17 15:26:51 +0100 2011, Philippe LeCavalier wrote:
 
> This is more of a vim question than it is a sup one but I'm not a
> member of the vim list so I thought I'd ask you guys first.
> 
> Since I don't write very well I always end up making changes while
> re-reading myself. When I edit a line Vim doesn't wrap anymore like it
> did when I first typed the text. So all the lines I've edited aren't
> wrapped like the others. It can make reading my mail challenging at
> times.
> 
> Perhaps I'm misunderstanding how to properly edit text in vim?

I guess this can be called a 'feature' of vim, Bram probably has a good
reason for making it behave as it does. 

As far as I know, wrapping only occurs when you are in insert mode
adding text at the end of the current line, but not when you are
inserting text in the middle of a line.

My own habit is to just add or remove the text as a go, and hit the key
sequence 'gwap' to clean up the mess, which means so much as 'reformat
(rewrap) the current paragraph'. The vim help for 'gw':

  gw{motion}    Format the lines that {motion} moves over.  Similar to
                |gq| but puts the cursor back at the same position in
                the text.  However, 'formatprg' and 'formatexpr' are
                not used.  {not in Vi}

where {motion} would be 'ap', meaning 'a paragraph'.

It looks kind of cumbersome in the beginning, but I'm very much used to
it and don't even think about it anymore.



-- 
:wq
^X^Cy^K^X^C^C^C^C
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk