Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

line wrap around in vi

0 views
Skip to first unread message

Stephen M. Waite

unread,
Apr 2, 1998, 3:00:00 AM4/2/98
to

Is there a way to turn off line wrap around in vi? I have a file with
record length greater than 80. vi wraps this around and makes it
difficult to view the file.

Thanks,
Steve

Bill Vermillion

unread,
Apr 2, 1998, 3:00:00 AM4/2/98
to

In your .exrc/.virc set the default you wish.

(highly edited from mine)
set shell=/bin/sh
set wrapmargin=13
set nu nomesg autoindent

wrapmargin tells you how far from the end of the line to be before
the line is wrapped automatically.

I use 13 because I have the line numbers turned on and that starts
the wrap soon enough to keep everything readable. If I set it
lower then it wraps on the display when number are turned on, but
not if they are off.

80 - 13 = 67 . So it will wrap, and split at the previous space on
anyline that exceeds 67 characters.

--
bi...@bilver.magicnet.netREMOVETHIS | bi...@bilver.comREMOVETHIS
(Remove the anti-spam section from the address on a mail reply)

Jack The Ripper

unread,
Apr 2, 1998, 3:00:00 AM4/2/98
to

"Stephen M. Waite" <sm...@sover.net> writes:
>Is there a way to turn off line wrap around in vi?
first, man vi (warning, it is long and detailed)

second, you can always type
:se wm=0
which will turn off word-wrapping for input (no automagic line breaks)

But I sense you are using a larger screen and smaller font and want it
all to display un-wrapped, and that is outta my league, cuz I just have a
simple text-based console and don't use X 'cuz it acts funky on my system
--
73, Jack W4KH
ja...@sco.theporch.com - "Plus ca change, plus c'est la meme chose"
"Il n'y a que les idiots qui ne changent jamais d'idee"

T.E.Dickey

unread,
Apr 2, 1998, 3:00:00 AM4/2/98
to

Stephen M. Waite <sm...@sover.net> wrote:
: Is there a way to turn off line wrap around in vi? I have a file with

: record length greater than 80. vi wraps this around and makes it
: difficult to view the file.
no. but some of the vi-clones do this (vile and vim -- I don't think it
is changeable in nvi or elvis).

The current version of vile is 7.3
It's available at
http://www.clark.net/pub/dickey/vile/vile.html
ftp.clark.net/pub/dickey/vile
id.wing.net/pub/pgf/vile

--
Thomas E. Dickey
dic...@clark.net
http://www.clark.net/pub/dickey

Lucky Leavell

unread,
Apr 3, 1998, 3:00:00 AM4/3/98
to

On Thu, 2 Apr 1998, Stephen M. Waite wrote:

> Is there a way to turn off line wrap around in vi? I have a file with
> record length greater than 80. vi wraps this around and makes it
> difficult to view the file.
>

I set wm=0: first ":" to get to command prompt, then enter "wm=0". This
would apply to the current session only; I suppose you could put it in
.exrc to make it universal.

Thank you,
Lucky

Lucky Leavell Phone: (800) 481-2393
UniXpress - Your Source for SCO OR: (812) 989-0174
1560 Zoar Church Road NE FAX: (812) 366-3618
Corydon, IN 47112-7374 Email: lu...@UniXpress.com
WWW Home Page: http://www.UniXpress.com


Lucky Leavell

unread,
Apr 3, 1998, 3:00:00 AM4/3/98
to

On Thu, 2 Apr 1998, Stephen M. Waite wrote:

> Is there a way to turn off line wrap around in vi? I have a file with
> record length greater than 80. vi wraps this around and makes it
> difficult to view the file.
>

Ooops! Should have tried it first before posting. After the ":", type

set wm=0

followed by a <RETURN>.

Kevin Smith

unread,
Apr 3, 1998, 3:00:00 AM4/3/98
to

In article <35235A...@sover.net> "Stephen M. Waite" <sm...@sover.net> writes:
>Is there a way to turn off line wrap around in vi? I have a file with
>record length greater than 80. vi wraps this around and makes it
>difficult to view the file.

There have been several responses regarding setting the wrap margin and the
original poster hasn't responded but my guess is he is not happy with
the way vi displays lines wider than the display. I.e. by wrapping them
on the screen. I suspect he would like behavior like dos EDIT where
long lines just trail off the right margin and the screen display shifts
when the cursor gets out there. If that's the case, vi doesn't do that.
It has to wrap the lines. Your only option is to use a wider display,
which may not be possible if your display is the console in character
mode or a character terminal.
--
Do two rights make | Kevin Smith, ShadeTree Software, Philadelpha, PA, USA
a libertarian | 001-215-487-3811 shady.com,kevin bbs.cpcn.com,sysop

T.E.Dickey

unread,
Apr 3, 1998, 3:00:00 AM4/3/98
to

Kevin Smith <kbs=cu...@shady.com> wrote:

: In article <35235A...@sover.net> "Stephen M. Waite" <sm...@sover.net> writes:
:>Is there a way to turn off line wrap around in vi? I have a file with
:>record length greater than 80. vi wraps this around and makes it
:>difficult to view the file.

: on the screen. I suspect he would like behavior like dos EDIT where


: long lines just trail off the right margin and the screen display shifts
: when the cursor gets out there. If that's the case, vi doesn't do that.
: It has to wrap the lines. Your only option is to use a wider display,
: which may not be possible if your display is the console in character
: mode or a character terminal.

or use a vi-clone (such as vile, vim or elvis - the first two let you turn
the vi-style wrapping on/off)

0 new messages