Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] vim text wrapping
@ 2011-03-17 14:26 Philippe LeCavalier
  2011-03-17 15:14 ` Stanislav Ochotnicky
                   ` (8 more replies)
  0 siblings, 9 replies; 15+ messages in thread
From: Philippe LeCavalier @ 2011-03-17 14:26 UTC (permalink / raw)
  To: sup-talk

Hi All.

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?

-- 
Thanks,
Phil
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
@ 2011-03-17 15:14 ` Stanislav Ochotnicky
  2011-03-17 15:33 ` Paul Grove
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Stanislav Ochotnicky @ 2011-03-17 15:14 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 1098 bytes --]

Excerpts from Philippe LeCavalier's message of Thu Mar 17 15:26:51 +0100 2011:
> Hi All.
>
> 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.

Really not a sup question at all, but I have no problem trying to
answer. Others might feel different though :-)

> 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.

How about "gqq"? Also "set nopaste" and "set textwidth=72" should be
of help most of the time.

> Perhaps I'm misunderstanding how to properly edit text in vim?

Nah, vim might look like a simple editor but it has more features than
most people would believe :-)

--
Stanislav Ochotnicky <sochotnicky@redhat.com>
Software Engineer - Base Operating Systems Brno

PGP: 7B087241
Red Hat Inc.                               http://cz.redhat.com

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
  2011-03-17 15:14 ` Stanislav Ochotnicky
@ 2011-03-17 15:33 ` Paul Grove
  2011-03-17 16:10   ` James Taylor
  2011-03-17 15:40 ` Tyberius Prime
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 15+ messages in thread
From: Paul Grove @ 2011-03-17 15:33 UTC (permalink / raw)
  To: sup-talk

The answer to this question is in my interest also.

Excerpts from Philippe LeCavalier's message of Thu Mar 17 14:26:51 +0000 2011:
> Hi All.
> 
> 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?
> 
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
  2011-03-17 15:14 ` Stanislav Ochotnicky
  2011-03-17 15:33 ` Paul Grove
@ 2011-03-17 15:40 ` Tyberius Prime
  2011-03-17 15:52 ` Bruno d'Arcangeli
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Tyberius Prime @ 2011-03-17 15:40 UTC (permalink / raw)
  To: sup-talk

Hey, 

I usually just hit gqap on every paragraph that looks out of line, and vim
rewraps it for me.

See http://vimdoc.sourceforge.net/htmldoc/change.html#gq


So long,
Tyberius Prime

Excerpts from Philippe LeCavalier's message of Do Mär 17 15:26:51 +0100 2011:
> Hi All.
> 
> 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?
> 
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
                   ` (2 preceding siblings ...)
  2011-03-17 15:40 ` Tyberius Prime
@ 2011-03-17 15:52 ` Bruno d'Arcangeli
  2011-03-17 16:04 ` Erin Sheldon
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Bruno d'Arcangeli @ 2011-03-17 15:52 UTC (permalink / raw)
  To: sup-talk

Le 17/03/2011 à 15:26, Philippe LeCavalier a écrit:
> Hi All.
> 
> 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'm not a vim expert but simple user and i think that you can't. I've
seen many people asking for this on different vim list/forum. It's
apparently a vi functionality and can't be changed.
-- 
Bruno d'Arcangeli
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
                   ` (3 preceding siblings ...)
  2011-03-17 15:52 ` Bruno d'Arcangeli
@ 2011-03-17 16:04 ` Erin Sheldon
  2011-03-17 16:05 ` Peter Lewis
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Erin Sheldon @ 2011-03-17 16:04 UTC (permalink / raw)
  To: Philippe LeCavalier; +Cc: sup-talk

On Thu, Mar 17, 2011 at 10:26 AM, Philippe LeCavalier
<support@plecavalier.com> wrote:
> Hi All.
>
> 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?

You can have vim justify all the text in a paragraph.  I have these in
my .vimrc, which makes typing Q justify the text.

" n is for normal mode
nnoremap Q gqap
" v is for visual mode.
vnoremap Q gq



>
> --
> Thanks,
> Phil
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
>



-- 
Erin Scott Sheldon
Brookhaven National Laboratory
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
                   ` (4 preceding siblings ...)
  2011-03-17 16:04 ` Erin Sheldon
@ 2011-03-17 16:05 ` Peter Lewis
  2011-03-17 16:12 ` Amadeusz Żołnowski
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 15+ messages in thread
From: Peter Lewis @ 2011-03-17 16:05 UTC (permalink / raw)
  To: sup-talk

Hi,

On Thu, 17 Mar 2011, Philippe LeCavalier wrote:
> 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.

I've not managed to get vim to do this automatically (I haven't tried much
though). What I usually do is, once I've re-edited a paragraph and it has some
overflowing lines, go to that paragraph in Normal mode and do:

vip  (to select the whole paragraph), then
gq   (to rewrap the selected text).

HTH,

Pete.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 15:33 ` Paul Grove
@ 2011-03-17 16:10   ` James Taylor
  0 siblings, 0 replies; 15+ messages in thread
From: James Taylor @ 2011-03-17 16:10 UTC (permalink / raw)
  To: sup-talk

I use gqap constantly while writing email and other prose in vim.

(:help gq gives you the following)

"""
gqgq                                                    gqgq gqq
gqq                     Format the current line.  With a count format that
                        many lines.  {not in Vi}

                                                        v_gq
{Visual}gq              Format the highlighted text.  (for {Visual} see
                        Visual-mode).  {not in Vi}

                                                        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}

gwgw                                                    gwgw gww
gww                     Format the current line as with "gw".  {not in Vi}

                                                        v_gw
{Visual}gw              Format the highlighted text as with "gw".  (for
                        {Visual} see Visual-mode).  {not in Vi}

Example: To format the current paragraph use:                   gqap  >
        gqap

The "gq" command leaves the cursor in the line where the motion command takes
the cursor.  This allows you to repeat formatting repeated with ".".  This
works well with "gqj" (format current and next line) and "gq}" (format until
end of paragraph).  Note: When 'formatprg' is set, "gq" leaves the cursor on
the first formatted line (as with using a filter command).

If you want to format the current paragraph and continue where you were, use: >
        gwap
If you always want to keep paragraphs formatted you may want to add the 'a'
flag to 'formatoptions'.  See auto-format.
"""





On Mar 17, 2011, at 11:33 AM, Paul Grove wrote:

> The answer to this question is in my interest also.
> 
> Excerpts from Philippe LeCavalier's message of Thu Mar 17 14:26:51 +0000 2011:
>> Hi All.
>> 
>> 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?
>> 
> _______________________________________________
> sup-talk mailing list
> sup-talk@rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk

-- jt

James Taylor, Assistant Professor, Biology / Computer Science, Emory University




_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
                   ` (5 preceding siblings ...)
  2011-03-17 16:05 ` Peter Lewis
@ 2011-03-17 16:12 ` Amadeusz Żołnowski
  2011-03-17 16:47   ` Matthieu Rakotojaona
  2011-03-17 16:19 ` Ico Doornekamp
  2011-03-17 16:23 ` pancho horrillo
  8 siblings, 1 reply; 15+ messages in thread
From: Amadeusz Żołnowski @ 2011-03-17 16:12 UTC (permalink / raw)
  To: sup-talk


[-- Attachment #1.1: Type: text/plain, Size: 787 bytes --]

Excerpts from Philippe LeCavalier's message of Thu Mar 17 15:26:51 +0100 2011:
> 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?


In visual mode select blocks you'd like to fix and type 'gq' command. Is
it that you'd like to achieve?
-- 
Amadeusz Żołnowski

PGP key fpr: C700 CEDE 0C18 212E 49DA  4653 F013 4531 E1DB FAB5

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

[-- Attachment #2: Type: text/plain, Size: 140 bytes --]

_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
                   ` (6 preceding siblings ...)
  2011-03-17 16:12 ` Amadeusz Żołnowski
@ 2011-03-17 16:19 ` Ico Doornekamp
  2011-03-17 18:14   ` Philippe LeCavalier
  2011-03-17 16:23 ` pancho horrillo
  8 siblings, 1 reply; 15+ messages in thread
From: Ico Doornekamp @ 2011-03-17 16:19 UTC (permalink / raw)
  To: sup-talk

* 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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
                   ` (7 preceding siblings ...)
  2011-03-17 16:19 ` Ico Doornekamp
@ 2011-03-17 16:23 ` pancho horrillo
  2011-03-17 17:46   ` Bruno d'Arcangeli
  8 siblings, 1 reply; 15+ messages in thread
From: pancho horrillo @ 2011-03-17 16:23 UTC (permalink / raw)
  To: Philippe LeCavalier; +Cc: sup-talk

On Thu, Mar 17, 2011 at 10:26:51AM -0400, Philippe LeCavalier wrote:
> Hi All.
> 
Hi there.

> 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.
> 
For the sake of others:
If you want Vim to fold lines as you newly write them, just run
:set textwidth=72  # set tw=72 for short

If you want Vim to reformat the text when you edit it, just run
:set formatoptions+=a
or add it to your vimrc, etc.

This is explained in Vim help,
:help textwidth
:help ins-textwidth
:help formatoptions
:help fo-table

If you don't want this to happen all the time (as I don't),
you can use the gq operator discretionally.
gq <movement>, e.g.:
gq}     reflow till the end of the paragraph
gqap    reflow the whole paragraph

> Perhaps I'm misunderstanding how to properly edit text in vim?
> 
A minor tweak and you are done.

Hope that it helps.

Happy hacking,

-- 
pancho horrillo

To be conscious that
you are ignorant is a great step
to knowledge.

		Benjamin Disraeli
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 16:12 ` Amadeusz Żołnowski
@ 2011-03-17 16:47   ` Matthieu Rakotojaona
  0 siblings, 0 replies; 15+ messages in thread
From: Matthieu Rakotojaona @ 2011-03-17 16:47 UTC (permalink / raw)
  To: Amadeusz Żołnowski; +Cc: sup-talk

> 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.

Just like everyone said, I use

gqap

in the middle of a paragraph i'd like to reformat. Also of note, I set
my formatoptions like this :

:set formatoptions = tcq

which brings me more or less what I want. Check the man (:he
formatoptions) to see the different options for the formating.
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 16:23 ` pancho horrillo
@ 2011-03-17 17:46   ` Bruno d'Arcangeli
  0 siblings, 0 replies; 15+ messages in thread
From: Bruno d'Arcangeli @ 2011-03-17 17:46 UTC (permalink / raw)
  To: sup-talk

Le 17/03/2011 à 17:23, pancho horrillo a écrit:
> If you want Vim to reformat the text when you edit it, just run :set
> formatoptions+=a or add it to your vimrc, etc.  gq}     reflow till
> the end of the paragraph gqap    reflow the whole paragraph

Cool. Last time i've asked for this on a list, i was flamed.  I've added
this to my .vimrc:
au BufRead /tmp/sup.* set formatoptions+=a
-- 
Bruno d'Arcangeli
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 16:19 ` Ico Doornekamp
@ 2011-03-17 18:14   ` Philippe LeCavalier
  2011-03-18 13:56     ` Philippe LeCavalier
  0 siblings, 1 reply; 15+ messages in thread
From: Philippe LeCavalier @ 2011-03-17 18:14 UTC (permalink / raw)
  To: sup-talk

Excerpts from Ico Doornekamp's message of Thu Mar 17 12:19:29 -0400 2011:
> * 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
> 
That's pretty much what I expected since I had already visited the
options for textwidth and the like. I can certainly get used to a kbd
sequence since I expect that sort of thing when using Vim. In fact,
since adopting sup my hands don't really leave the keyboard.

However what James mentioned about formatoptions might alleviate that.
James, I add these types of things to my vim line in config.yaml rather
than my rc file. I to don't always want wrapping at 72 and the like. But
I do always want this in sup.
-- 
Thanks,
Phil
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [sup-talk] vim text wrapping
  2011-03-17 18:14   ` Philippe LeCavalier
@ 2011-03-18 13:56     ` Philippe LeCavalier
  0 siblings, 0 replies; 15+ messages in thread
From: Philippe LeCavalier @ 2011-03-18 13:56 UTC (permalink / raw)
  To: sup-talk

Excerpts from Philippe LeCavalier's message of Thu Mar 17 14:14:46 -0400 2011:
> Excerpts from Ico Doornekamp's message of Thu Mar 17 12:19:29 -0400 2011:
> > * 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
> > 
> That's pretty much what I expected since I had already visited the
> options for textwidth and the like. I can certainly get used to a kbd
> sequence since I expect that sort of thing when using Vim. In fact,
> since adopting sup my hands don't really leave the keyboard.
> 
> However what James mentioned about formatoptions might alleviate that.
> James, I add these types of things to my vim line in config.yaml rather
> than my rc file. I to don't always want wrapping at 72 and the like. But
> I do always want this in sup.

Thought I'd post back after having lived with formatoptions+=a for a
day. This options is _really_ annoying. It's hard to explain, but
although it does what I wanted in that it automatically wraps text when
editing lines it also drove me nuts because it prevents you from
inserting linebreaks -something I do regularly. So I'm back to just -c
'set textwidth=72' and will employ the gwap kbd sequence.
 
-- 
Thanks,
Phil
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2011-03-18 14:35 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-17 14:26 [sup-talk] vim text wrapping Philippe LeCavalier
2011-03-17 15:14 ` Stanislav Ochotnicky
2011-03-17 15:33 ` Paul Grove
2011-03-17 16:10   ` James Taylor
2011-03-17 15:40 ` Tyberius Prime
2011-03-17 15:52 ` Bruno d'Arcangeli
2011-03-17 16:04 ` Erin Sheldon
2011-03-17 16:05 ` Peter Lewis
2011-03-17 16:12 ` Amadeusz Żołnowski
2011-03-17 16:47   ` Matthieu Rakotojaona
2011-03-17 16:19 ` Ico Doornekamp
2011-03-17 18:14   ` Philippe LeCavalier
2011-03-18 13:56     ` Philippe LeCavalier
2011-03-17 16:23 ` pancho horrillo
2011-03-17 17:46   ` Bruno d'Arcangeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox