Seeing more with VIM

This is a discussion on Seeing more with VIM within the Tech Board forums, part of the Community Boards category; Hello,
I have a long list of numbers that I am doing a lot with. I want to print them ...

Seeing more with VIM

Hello,

I have a long list of numbers that I am doing a lot with. I want to print them out after every operation, to ensure that I have done the operation correctly. I am using VIM, but it seems that VIM will only allow me to see a certain number of lines when I execute my program. For example, if I have 500 lines of printout, it will only print out like 300 of them. I'm pretty sure this is a fault of VIM, because I can see small printouts just fine (like less than 200).

Is there a way to see all of the printout in VIM? If there is not, can you recommend another program that lets me execute programs and lets me see all of the printouts?

Are we to infer from "VIM" that you're using Linux (or some other non-windows OS)?

> Is there anything like microsoft visual studio, but for c?
What's this supposed to mean?
One is an IDE and the other is a language. It's like saying "is there anything like cabbage, but for horses".

300 lines seems more like the scroll-back limit of a default console, rather than anything to do with VIM.
Perhaps if you used the editor's navigation keys to move around the file, rather than dragging the scroll bars, you might see more of the file.

I'm thinking he's hitting the 512 character line length stated in the vim manual.

Maybe, but it seemed pretty clear that nkbxwb was talking about "a certain number of lines", e.g., "500 lines", not "500 characters".

Originally Posted by Salem

Are we to infer from "VIM" that you're using Linux (or some other non-windows OS)?

Official distributions of Vim are available for Windows though, so that inference is probably unwarranted.

Originally Posted by Yarin

I regularly open 1000+ line files in GVIM with a color theme with absolutely no visible penalty.

Hmm... nkbxwb, when you say "printout", you are referring to the content of files generated from your program that you view in Vim, not the content of files generated from your program that you are attempting to print on paper via Vim, right?

I have a long list of numbers that I am doing a lot with. I want to print them out after every operation, to ensure that I have done the operation correctly. I am using VIM, but it seems that VIM will only allow me to see a certain number of lines when I execute my program. For example, if I have 500 lines of printout, it will only print out like 300 of them. I'm pretty sure this is a fault of VIM, because I can see small printouts just fine (like less than 200).

How are you executing? I've been a vim user for years. In general I don't execute from it, but when I do, I've never noticed this problem. Most likely, as Salem suggests, this is because of your console. Try gvim instead.

If I do execute I use

:!whatever

Where "whatever" is the command.

Originally Posted by CommonTater

I'm thinking he's hitting the 512 character line length stated in the vim manual.

No, that is from ye olde unix vi. There is no such limit in vim.

To be honest, I don't see the purpose of using one megalithic app to edit, compile, and execute, when you can simply use VIM and flip back and forth between that and a console window. OTOH, I know the MS windows console leaves a lot to be desired, lol, if that is where you are...

VIM is dedicated to being the best code editor in the universe, but it will not make toast and coffee for you. You can try to use it that way (or switch to something that does claim to include the kitchen sink), or you can just learn to make toast and coffee the original way, which is pretty darn simple, really. It might even still be the simplest way, but YMMV.

Are we to infer from "VIM" that you're using Linux (or some other non-windows OS)?

> Is there anything like microsoft visual studio, but for c?
What's this supposed to mean?
One is an IDE and the other is a language. It's like saying "is there anything like cabbage, but for horses".

300 lines seems more like the scroll-back limit of a default console, rather than anything to do with VIM.
Perhaps if you used the editor's navigation keys to move around the file, rather than dragging the scroll bars, you might see more of the file.

What I mean by this is: Is there any program that is an IDE that can help me step into and debug my program. I know you can do it in visual studio, but it is a pain in the ass. You have to change file names, and such, and from the experiences I've had, it doesn't always turn out nice.

Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
What profit hath a man of all his labour which he taketh under the sun?
All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.

It was :! not !: And that was to be done in vi, not from bash. In vi, when in command mode, :!whatever opens a shell and executes the program whatever. In bash, ! is the start of a history command. For example, !! executes the previous command, !-3 the 3rd previous command. There are all sorts of tricks you can to do it to strip off the firs word, last word, parameter substitution, etc. It's quite sexy actually. If you're a regular Unix/Linux user, do "man bash" and search for the "HISTORY EXPANSION" section. It will change your life.

nkbxwb, you could upgrade, but i doubt your version is the problem.
I would try as MK27 suggested, and see if using GVIM instead doesn't fix your problem (it's generally nicer to use anyway).

anduril462, in bash/ksh, I press left when the line is blank, then I can use up and down to navigate my command history. No expansion necessary. I actually only mention this because you can do the same thing in VIM! Only, you have to type the colon first.

anduril462, in bash/ksh, I press left when the line is blank, then I can use up and down to navigate my command history. No expansion necessary. I actually only mention this because you can do the same thing in VIM! Only, you have to type the colon first.

I've never had to press left first, maybe that's a ksh thing. I use the up/down arrows a lot, but just as often I find the extra power of history expansion extremely useful. But I digress.

@nxbxwb: If you're looking for an IDE that works on Linux, try looking into Eclipse or Code::Blocks, both integrate with various debuggers, the main one on Linux being GDB. IIRC, emacs has GDB integration too. Both Eclipse and C::B have Windows versions too. Also on Windows, you have Pelles C, which is an IDE with debugger. I hear Pelles is good for beginners. If you plan on doing much Linux development, learning GDB is a must, whether it's from the command line or via an IDE integration.