Operating System - HP-UX
1753943 Members
9334 Online
108811 Solutions
New Discussion юеВ

Line too long problem in vi

 
SOLVED
Go to solution
Ramsunder S
Occasional Advisor

Line too long problem in vi

Hi,
Quite often we face the problem of "line too long" because of long trace lines while opening a file in vi. Is there a way to set the max line size while opening a file in vi.

Regards,
Ram.
5 REPLIES 5
A. Clay Stephenson
Acclaimed Contributor

Re: Line too long problem in vi

You are hitting the hard 2048 character limit. You might try another editor; e.g. emacs.
If it ain't broke, I can fix that.
Uday_S_Ankolekar
Honored Contributor
Solution

Re: Line too long problem in vi


Hi,

Use fold command before using vi. man fold for more info,

Also you use new version of called vim , you can get this from porting centre
http://hpux.cs.utah.edu/hppd/

-USA..

Good Luck..
S.K. Chan
Honored Contributor

Re: Line too long problem in vi

It's vi's buffer limit ( I think max is 2048 characters in a single line ). You can download "vim" which is the improved version of vi.
http://hpux.cs.utah.edu/hppd/hpux/Editors/vim-6.1/
Ramsunder S
Occasional Advisor

Re: Line too long problem in vi

Thank you all for your replies. Will download vim and check it out.
Just curious, is this 2048 limit hard-coded for vi. I mean is there no variable that can be set to increase this limit.

Regards,
Ram.
S.K. Chan
Honored Contributor

Re: Line too long problem in vi

Apparently there is .. but I'm not sure how it's done. If you look at patch PHCO_27057 (vi cumulative patch for 11.11), from the patch description ..

vi(1) was unable to handle files containing lines of length greater than 2048 characters.This was because, the buffers used in vi(1) were limited to 2048 characters.
Resolution:
The size of buffers has been changed from 2048 to 4096 characters.

So if you're running 11.11 the limit is doubled by installing this patch. I did not look at patches for other version of OS.