Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi all, would somebody help me?

Status
Not open for further replies.

jpernia

Technical User
Mar 29, 2002
35
US
Hi all, would somebody help me?

I got a problem with vi, i was trying to insert a line very long line and vi doesn’t accept it why, is there any variable that can increase the length of the line?
 
You probably get an error like the following:

ex: 0602-138 An input line cannot be longer than 2048 characters.

You cannot change this limit in vi. Best suggestion is to try VIM (
 
According to the manpage, the maximum length of a line in vi is defined by LINE_MAX. It appears to be a compiled-in constant, so I don't believe you can change it. (I tried setting it as an env var, and also as a vi var, no luck).
 
Maximum Line Length
LINE_MAX characters (defined in <limits.h>), including 2-3 bytes for overhead. Thus, if the value specified for LINE_MAX is 2048, a line length up to 2044 characters should cause no problem.

If you load a file that contain lines longer than the specified limit, the lines are truncated to the stated maximum length. Saving the file will write the truncated version over the original file, thus overwriting the original lines completely.

Attempting to create lines longer than the allowable maximum for the editor produces a line too long error message.

Maximum File Size
The maximum file length of 234,239 lines is silently enforced
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top