public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] {OT} vi line breaks
@ 2006-08-05 21:19 Grant
  2006-08-05 21:41 ` Alexander Skwar
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Grant @ 2006-08-05 21:19 UTC (permalink / raw
  To: Gentoo mailing list

Does anyone know how to prevent vi from inserting a line break after
every however many characters?

- Grant
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:19 [gentoo-user] {OT} vi line breaks Grant
@ 2006-08-05 21:41 ` Alexander Skwar
  2006-08-05 22:32   ` Michael Sullivan
  2006-08-05 21:48 ` Richard Fish
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Alexander Skwar @ 2006-08-05 21:41 UTC (permalink / raw
  To: gentoo-user

Grant schrieb:
> Does anyone know how to prevent vi from inserting a line break after
> every however many characters?

Hm. How did you enable that in the first place?

You might want to check your /etc/vim/* and ~/.vim* files.

Alexander Skwar
-- 
Audience: What will become of Linux when the Hurd is ready?
Eric Youngdale: Err... is Richard Stallman here?
		-- From the Linux conference in spring '95, Berlin
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:19 [gentoo-user] {OT} vi line breaks Grant
  2006-08-05 21:41 ` Alexander Skwar
@ 2006-08-05 21:48 ` Richard Fish
  2006-08-06  2:01   ` Meino Christian Cramer
  2006-08-05 21:48 ` Justin R Findlay
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 17+ messages in thread
From: Richard Fish @ 2006-08-05 21:48 UTC (permalink / raw
  To: gentoo-user

On 8/5/06, Grant <emailgrant@gmail.com> wrote:
> Does anyone know how to prevent vi from inserting a line break after
> every however many characters?

Is it actually inserting line breaks?  Or just wrapping long lines for display?

If actually inserting line breaks, then you have textwidth set
somewhere.  You can turn it of with:

:set textwidth 0

If it is just for display:

:set nowrap

BTW, :help will give you the built-in help system.

Of course, there is also a method of fixing this in bash.

alias vi=kedit

:-)

-Richard
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:19 [gentoo-user] {OT} vi line breaks Grant
  2006-08-05 21:41 ` Alexander Skwar
  2006-08-05 21:48 ` Richard Fish
@ 2006-08-05 21:48 ` Justin R Findlay
  2006-08-05 22:56   ` Grant
  2006-08-05 23:25   ` Grant
  2006-08-05 21:55 ` Mark
  2006-08-05 22:12 ` Rick van Hattem
  4 siblings, 2 replies; 17+ messages in thread
From: Justin R Findlay @ 2006-08-05 21:48 UTC (permalink / raw
  To: gentoo-user

On Sat, Aug 05, 2006 at 02:19:41PM -0700, Grant wrote:
> Does anyone know how to prevent vi from inserting a line break after
> every however many characters?

:set nolinebreak

echo set nolinebreak >> ~/.vimrc


Justin
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:19 [gentoo-user] {OT} vi line breaks Grant
                   ` (2 preceding siblings ...)
  2006-08-05 21:48 ` Justin R Findlay
@ 2006-08-05 21:55 ` Mark
  2006-08-05 22:12 ` Rick van Hattem
  4 siblings, 0 replies; 17+ messages in thread
From: Mark @ 2006-08-05 21:55 UTC (permalink / raw
  To: gentoo-user

Look for:
set textwidth=....

Or shorthand:
set tw=...

If you set this to 0 .. then it will not wrap. You can do this on a
per file basis with the vim modelines:

# vim:set tw=0:

As suggested look in the rc files.

Thanks
Mark
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:19 [gentoo-user] {OT} vi line breaks Grant
                   ` (3 preceding siblings ...)
  2006-08-05 21:55 ` Mark
@ 2006-08-05 22:12 ` Rick van Hattem
  2006-08-05 23:00   ` Grant
  4 siblings, 1 reply; 17+ messages in thread
From: Rick van Hattem @ 2006-08-05 22:12 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

On Saturday 05 August 2006 23:19, Grant wrote:
> Does anyone know how to prevent vi from inserting a line break after
> every however many characters?
>
> - Grant
vi doesn't do that on default, perhaps you mean line wrapping?
If so, "set nowrap" should fix it :)

Put it in your ~/.vimrc to make it default

-- 
Rick van Hattem	Rick.van.Hattem(at)Fawo.nl

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:41 ` Alexander Skwar
@ 2006-08-05 22:32   ` Michael Sullivan
  0 siblings, 0 replies; 17+ messages in thread
From: Michael Sullivan @ 2006-08-05 22:32 UTC (permalink / raw
  To: gentoo-user

On Sat, 2006-08-05 at 23:41 +0200, Alexander Skwar wrote:
> Grant schrieb:
> > Does anyone know how to prevent vi from inserting a line break after
> > every however many characters?
> 
> Hm. How did you enable that in the first place?
> 
> You might want to check your /etc/vim/* and ~/.vim* files.
> 
> Alexander Skwar
> -- 
> Audience: What will become of Linux when the Hurd is ready?
> Eric Youngdale: Err... is Richard Stallman here?
> 		-- From the Linux conference in spring '95, Berlin

First of all, are you sure that it's actually a line break and not a
line wrap?  Find a line of text that seems to take up multiple lines.
Go to the beginning of that line and hit the End key.  If the cursor
jumps to another line, you know it's a line wrap, and it can be turned
off with "set nowrap".

-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:48 ` Justin R Findlay
@ 2006-08-05 22:56   ` Grant
  2006-08-05 23:25   ` Grant
  1 sibling, 0 replies; 17+ messages in thread
From: Grant @ 2006-08-05 22:56 UTC (permalink / raw
  To: gentoo-user

> > Does anyone know how to prevent vi from inserting a line break after
> > every however many characters?
>
> :set nolinebreak
>
> echo set nolinebreak >> ~/.vimrc

Yes!  Freedom!  Thank you everyone.

- Grant
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 22:12 ` Rick van Hattem
@ 2006-08-05 23:00   ` Grant
  0 siblings, 0 replies; 17+ messages in thread
From: Grant @ 2006-08-05 23:00 UTC (permalink / raw
  To: gentoo-user

> > Does anyone know how to prevent vi from inserting a line break after
> > every however many characters?
> >
> > - Grant
> vi doesn't do that on default, perhaps you mean line wrapping?
> If so, "set nowrap" should fix it :)

nolinebreak actually fixed it.  Does anyone know why vi might be
inserting line breaks by default?  This is happening on my laptop and
server for all users.  I've never configured vi whatsoever.

- Grant
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:48 ` Justin R Findlay
  2006-08-05 22:56   ` Grant
@ 2006-08-05 23:25   ` Grant
  2006-08-06  7:19     ` Justin R Findlay
  1 sibling, 1 reply; 17+ messages in thread
From: Grant @ 2006-08-05 23:25 UTC (permalink / raw
  To: gentoo-user

> > Does anyone know how to prevent vi from inserting a line break after
> > every however many characters?
>
> :set nolinebreak
>
> echo set nolinebreak >> ~/.vimrc

This worked great for plain vi, but the problem persists with mutt.
Any suggestions for mutt?

- Grant
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 21:48 ` Richard Fish
@ 2006-08-06  2:01   ` Meino Christian Cramer
  2006-08-06  2:17     ` Philip Webb
  2006-08-06  2:19     ` Willie Wong
  0 siblings, 2 replies; 17+ messages in thread
From: Meino Christian Cramer @ 2006-08-06  2:01 UTC (permalink / raw
  To: gentoo-user, bigfish

From: "Richard Fish" <bigfish@asmallpond.org>
Subject: Re: [gentoo-user] {OT} vi line breaks
Date: Sat, 5 Aug 2006 14:48:53 -0700


Hi,

 I have kinda "reverse question" to this vi/vim problem: I am using
 vim as vim (not in compatible mode). 

 When writing "normal" text in Emacs or loading normal text into emacs
 there was the possibility to reformat paragraphs wirh
 "fill-paragraphs" (ALT-Q) so there were linebreaks inserted and
 removed to make the paragraph fit best into the previously defined
 width of the line.

 I cannot find this functionality in vim...is there anything like
 that?

 Kind regards,
 mcc

 



> On 8/5/06, Grant <emailgrant@gmail.com> wrote:
> > Does anyone know how to prevent vi from inserting a line break after
> > every however many characters?
> 
> Is it actually inserting line breaks?  Or just wrapping long lines for display?
> 
> If actually inserting line breaks, then you have textwidth set
> somewhere.  You can turn it of with:
> 
> :set textwidth 0
> 
> If it is just for display:
> 
> :set nowrap
> 
> BTW, :help will give you the built-in help system.
> 
> Of course, there is also a method of fixing this in bash.
> 
> alias vi=kedit
> 
> :-)
> 
> -Richard
> -- 
> gentoo-user@gentoo.org mailing list
> 
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-06  2:01   ` Meino Christian Cramer
@ 2006-08-06  2:17     ` Philip Webb
  2006-08-06  2:19     ` Willie Wong
  1 sibling, 0 replies; 17+ messages in thread
From: Philip Webb @ 2006-08-06  2:17 UTC (permalink / raw
  To: gentoo-user

060806 Meino Christian Cramer wrote:
> When writing "normal" text in Emacs or loading normal text into emacs
> one could reformat paragraphs with "fill-paragraphs" (ALT-Q)
> so there were linebreaks inserted and removed
> to make the paragraph fit best into the previously defined line width.
> I cannot find this functionality in vim: is there anything like that?

Do you mean ':set lbr' ?

-- 
========================,,============================================
SUPPORT     ___________//___,  Philip Webb : purslow@chass.utoronto.ca
ELECTRIC   /] [] [] [] [] []|  Centre for Urban & Community Studies
TRANSIT    `-O----------O---'  University of Toronto
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-06  2:01   ` Meino Christian Cramer
  2006-08-06  2:17     ` Philip Webb
@ 2006-08-06  2:19     ` Willie Wong
  1 sibling, 0 replies; 17+ messages in thread
From: Willie Wong @ 2006-08-06  2:19 UTC (permalink / raw
  To: gentoo-user

On Sun, Aug 06, 2006 at 04:01:57AM +0200, Penguin Lover Meino Christian Cramer squawked:
>  When writing "normal" text in Emacs or loading normal text into emacs
>  there was the possibility to reformat paragraphs wirh
>  "fill-paragraphs" (ALT-Q) so there were linebreaks inserted and
>  removed to make the paragraph fit best into the previously defined
>  width of the line.
> 
>  I cannot find this functionality in vim...is there anything like
>  that?

>From user_10.txt of the vim help manual:

===============begin quote====================
Now lines will be broken to take only up to 72 characters.  But when you
insert text halfway a line, or when you delete a few words, the lines will get
too long or too short.  Vim doesn't automatically reformat the text.
   To tell Vim to format the current paragraph: >

        gqap

This starts with the "gq" command, which is an operator.  Following is "ap",
the text object that stands for "a paragraph".  A paragraph is separated from
the next paragraph by an empty line.

        Note:
        A blank line, which contains white space, does NOT separate
        paragraphs.  This is hard to notice!

Instead of "ap" you could use any motion or text object.  If your paragraphs
are properly separated, you can use this command to format the whole file: >

        gggqG

"gg" takes you to the first line, "gq" is the format operator and "G" the
motion that jumps to the last line.

In case your paragraphs aren't clearly defined, you can format just the lines
you manually select.  Move the cursor to the first line you want to format.
Start with the command "gqj".  This formats the current line and the one below
it.  If the first line was short, words from the next line will be appended.
If it was too long, words will be moved to the next line.  The cursor moves to
the second line.  Now you can use "." to repeat the command.  Keep doing this
until you are at the end of the text you want to format.
==================end quote=======================

HTH, 

W
-- 
When cryptography is outlawed,
bayl bhgynjf jvyy unir cevinpl.
Sortir en Pantoufles: up 10 days,  5:22
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-05 23:25   ` Grant
@ 2006-08-06  7:19     ` Justin R Findlay
  2006-08-06 14:33       ` Grant
  0 siblings, 1 reply; 17+ messages in thread
From: Justin R Findlay @ 2006-08-06  7:19 UTC (permalink / raw
  To: gentoo-user

On Sat, Aug 05, 2006 at 04:25:09PM -0700, Grant wrote:
> This worked great for plain vi, but the problem persists with mutt.
> Any suggestions for mutt?

This is my mutt editor command.  Suit it to your desires, although I
reccommend keeping the line breaks unless you know of a way to get mutt
to format the outgoing mail with line breaks instead of having vim do it
in line as it gets kind of tedious reformating the text when you have a
difficult email to write. (:

But even on this account I may be able to offer some knowledge.  When
you need to reformat some text just select the text with <ctrl>-v or
<shift>-v or 'v' and do 'gq'.

$ grep editor ~/.muttrc
set editor="vim +/^$ -c 'set linebreak ft=mail'"


Justin
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-06  7:19     ` Justin R Findlay
@ 2006-08-06 14:33       ` Grant
  2006-08-06 21:10         ` Willie Wong
  0 siblings, 1 reply; 17+ messages in thread
From: Grant @ 2006-08-06 14:33 UTC (permalink / raw
  To: gentoo-user

> > This worked great for plain vi, but the problem persists with mutt.
> > Any suggestions for mutt?
>
> This is my mutt editor command.  Suit it to your desires, although I
> reccommend keeping the line breaks unless you know of a way to get mutt
> to format the outgoing mail with line breaks instead of having vim do it
> in line as it gets kind of tedious reformating the text when you have a
> difficult email to write. (:

Why would you want automatic line breaks in your email though?  Won't
every email client wrap text at an appropriate point for viewing?

> But even on this account I may be able to offer some knowledge.  When
> you need to reformat some text just select the text with <ctrl>-v or
> <shift>-v or 'v' and do 'gq'.
>
> $ grep editor ~/.muttrc
> set editor="vim +/^$ -c 'set linebreak ft=mail'"

I tried the following to stop mutt from adding line breaks but it doesn't work:

set editor="vim -c 'set nolinebreak'"

Can you help me fix that?

- Grant
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-06 14:33       ` Grant
@ 2006-08-06 21:10         ` Willie Wong
  2006-08-09 15:45           ` Grant
  0 siblings, 1 reply; 17+ messages in thread
From: Willie Wong @ 2006-08-06 21:10 UTC (permalink / raw
  To: gentoo-user

On Sun, Aug 06, 2006 at 07:33:39AM -0700, Penguin Lover Grant squawked:
> >$ grep editor ~/.muttrc
> >set editor="vim +/^$ -c 'set linebreak ft=mail'"
> 
> I tried the following to stop mutt from adding line breaks but it doesn't 
> work:
> 
> set editor="vim -c 'set nolinebreak'"

See my other email for the difference between linebreak and textwidth.
>From what I read of your preference, it sounds like you want to turn
off textwidth (set it to 0) and keep linebreak. 

W
-- 
As long as the universe is much greater than 1, we can safely say
that this term is zero.
       ~Prof. Kirk T. McDonald, DeathEM, P-town PHY 304
Sortir en Pantoufles: up 11 days, 13 min
-- 
gentoo-user@gentoo.org mailing list



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

* Re: [gentoo-user] {OT} vi line breaks
  2006-08-06 21:10         ` Willie Wong
@ 2006-08-09 15:45           ` Grant
  0 siblings, 0 replies; 17+ messages in thread
From: Grant @ 2006-08-09 15:45 UTC (permalink / raw
  To: gentoo-user

> > >$ grep editor ~/.muttrc
> > >set editor="vim +/^$ -c 'set linebreak ft=mail'"
> >
> > I tried the following to stop mutt from adding line breaks but it doesn't
> > work:
> >
> > set editor="vim -c 'set nolinebreak'"
>
> See my other email for the difference between linebreak and textwidth.
> From what I read of your preference, it sounds like you want to turn
> off textwidth (set it to 0) and keep linebreak.
>
> W

I now have the following in .vimrc:

:set textwidth=0
:set nolinebreak

and both vi and mutt are still creating line breaks.  Definitely
separate lines.  I'd really like to fix this.

- Grant
-- 
gentoo-user@gentoo.org mailing list



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

end of thread, other threads:[~2006-08-09 15:55 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-05 21:19 [gentoo-user] {OT} vi line breaks Grant
2006-08-05 21:41 ` Alexander Skwar
2006-08-05 22:32   ` Michael Sullivan
2006-08-05 21:48 ` Richard Fish
2006-08-06  2:01   ` Meino Christian Cramer
2006-08-06  2:17     ` Philip Webb
2006-08-06  2:19     ` Willie Wong
2006-08-05 21:48 ` Justin R Findlay
2006-08-05 22:56   ` Grant
2006-08-05 23:25   ` Grant
2006-08-06  7:19     ` Justin R Findlay
2006-08-06 14:33       ` Grant
2006-08-06 21:10         ` Willie Wong
2006-08-09 15:45           ` Grant
2006-08-05 21:55 ` Mark
2006-08-05 22:12 ` Rick van Hattem
2006-08-05 23:00   ` Grant

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