Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Feel free to point me to the appropriate documentation for this.

When in ex mode ( Q ) and entering numerous commands, the file scrolls up to where you can't see what you're working on.

Are there key bindings for scrolling the visible file while in ex mode? Ctrl-J puts lines in the ex window - but there doesn't seem to be a way to go the other direction - Ctrl-J scrolls down by line. Maybe it's the OS or Vim version?

Is there a setting to keep ex from scrolling the file up? Very annoying.

Thanks ~

Bubnoff

share|improve this question
    
No ex mode users? –  Bubnoff Nov 13 '10 at 3:08

2 Answers 2

up vote 1 down vote accepted

Is :p command which prints current line enough?.

Try :-5,+5p for context and replace p with # go get line numbers.

Edit: Just found :z which is better, as it does not move the cursor as :p does.

And a counter-question: I wonder why using ex-mode?

I am using vim for over 10 years and so far have not found any use for it (but can imagine some like editing very long lines or working over very slow connection.)

share|improve this answer
    
Thanks! That is helpful. –  Bubnoff Dec 10 '11 at 19:39

That's the whole point of ex mode -- ex has always been a line editor, and was never a screen editor. vi basically turned ex into a screen editor, and kept ex mode so it could be backwards compatible.

If you want to see what you're doing then use the 'p' command, so:

:p       Show current line
:.,+10p  Print lines from current line to ten lines down
:1,$p    Print all lines in the file

[etc].

share|improve this answer
    
Good tips, thank you. –  Bubnoff Dec 10 '11 at 19:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.