Vi horizontal scrolling

I have to look through logfiles where lines are several hundred characters long and if I open the log in Vi it automatically word wraps the line. In Vim you can use the -nowrap option to stop this, but how can you do this in Vi?
I ask because I don't want to see the whole line, just the first few characters... but I do want to see the next line directly below.

For example instead of seeing in vi:

Line1
Line1(cont)
Line1(cont)
Line2
Line2(cont)
Line3

I want to see:

Line1......scroll offscreen
Line2......scroll offscreen
Line3

Thanks for any help

"regular" vi doesn't support that - elvis and vim do.

try

cut -c 1-60 | more

more allows you to do pattern searches and move down thru the buffer.

Thanks, but I get the following error:

cut: No such command from open/visual

I am using vi on a SunOS 5.8 Generic_108528-12 sun4u sparc SUNW box...

any help appreciated

My example has a problem should be -

cut -c 1-50 <filename> | more

try

which cut

to see if it is in your path. Your PATH variable may have a problem. If you can get the man page for cut:
man cut

Then it sounds like you are on some sort of restricted shell on a workstation because on

SunOS 5.8 Generic_108528-10 sun4u sparc SUNW,UltraSPARC-IIi-Engine

there is cut.

Sounds like you're trying to run cut from within vi itself in command mode (i.e. you've done :cut). Whilst you can run commands within vi
i.e. <ESC>:!ls -l | more, the example Jim has given you is intended for use at the command line. "more" itself will allow you to search (using / much like vi).

Cheers
ZB

You can send the log file thru cut from within vi using...

:%!cut -c-50

...but don't save changes.

Thanks... this goes much of the way towards perfection!!

the cut tool is producing good results using:

cut -c -158 <filename> | more

or from within Vi:

:%!cut -c -158

Think i prefer the latter, you can use :u to reverse changes...

So I can see my info arranged on a line by line basis, from this quickly see correct or incorrect operations, and then use :u to scroll into a particular line...

not bad, but in Vi we conclude that there is no horizontal scroll or line arranger?

Thanks again...

one more thing...

can I alias my :%!cut -c -158 command within vi to a simpler keystroke, like :i or something?

Create a macro like this ....in vo editor

:map #1 :%!cut -c -5^M

by creating this macro ... u can press F1 key to get yr command executed.

U can also put set of those command in $HOME./.exrc file
and those macros will be automatically loaded for each vi session for them to be used.

Note : ^M is nothing but CTRL+V followed by CTRL+M