I’ve search a lot of Vi documentation for this problem, but couldn’t find anything. Anybody have an idea what Vi setting I should change to make Vi show all of a file’s content. My problem is, everytime I open a file with Vi, it will always show a few lines only. The rest of the lines is sort of hidden with a line showing that there are a certain number of lines below it, hidden. For example, one file I open will contain something like this:
On 06/16/2011 03:08 PM, DenverD wrote:
> On 06/16/2011 09:06 PM, fading wrote:
>> I can expand the line with any insert command (a, i, o, etc) but is
>> there a way to make Vi automatically expand the lines?
> i’ll tell you how i solved that problem: i installed midnight commander
> and instead of typing “vi” i type “mc” and get a file editor, file
> manager, an ftp client, and and and and . . .
> try it!!
> the only downside is that vi[m] is “always” included on “any” *nix machine
> you might sit down at or ssh into…mc, maybe or maybe not…
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.15 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
On 06/16/2011 12:06 PM, fading wrote:
> …] My problem is, everytime I open a
> file with Vi, it will always show a few lines only. The rest of the
> lines is sort of hidden with a line showing that there are a certain
> number of lines below it, hidden. For example, one file I open will
> contain something like this:
> mg.inp simulation created by user1
> bomlev -2
> – +94-lines -------------------------------------------
<My knowledge of Vim is elementary.>
I have never seen it, either. It seems a configuration issue. I can make
only 10 lines to be seen, by issuing, in the command mode, “:set
lines=10”, or by inserting ~/.vimrc a line “set lines=10”. In either
case, the “xterm” shrinks to show only 10 lines. But I don’t get the line:
– +xxx lines -------.
(By using ~/.vimrc disables “vi” compatibility; I insert “set
nocompatible” in this file, just to make sure.)
1). Is the number of visible lines the same each time you launch “vi”?
And does the size of the terminal emulator shrink to show only
those lines or does the size remain the usual size, with blank
lines below those lines?
2). Are you issuing the command “vi” on the command-line in a terminal,
without disabling vi compatibility?
3). “Vim” is installed by default, I think. Is it actually installed?
4). With “vi”, “:set window=10” / “set window=10” is said to do the
trick. With “Vim”, this has no effect (no error warning, either,
according to my reference).
Anyway, there’s newsgroup “comp.editors” where very knowledgeable
people, especially about “Vim”, hang around. Try that one; your case is
It looks like code folding. It’s a feature of Vim, to let you navigate around fast by hiding chunks of code(Like some comments, functions, etc). Check this link Code folding in vim -Smarticus , I think this will solve your problem :). I too was annoyed with code folding, but later on found in useful in navigating big files.