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
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 at redhat.com> Software Engineer - Base Operating Systems Brno PGP: 7B087241 Red Hat Inc. http://cz.redhat.com -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20110317/da02261c/attachment.bin>
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? >
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? >
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
On Thu, Mar 17, 2011 at 10:26 AM, Philippe LeCavalier <support at 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 at rubyforge.org > http://rubyforge.org/mailman/listinfo/sup-talk >-- Erin Scott Sheldon Brookhaven National Laboratory
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.
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 at rubyforge.org
> http://rubyforge.org/mailman/listinfo/sup-talk
-- jt
James Taylor, Assistant Professor, Biology / Computer Science, Emory University
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 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: not available URL: <http://rubyforge.org/pipermail/sup-talk/attachments/20110317/9e59f21d/attachment-0001.bin>
* 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
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
> 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.
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 paragraphCool. 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
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 at 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
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 at 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