views:

549

answers:

4

Hello,

I have a big file with thousands of lines of thousands of characters.

I move the cursor to 3000th character.

If I use PageDown or <CTRL>-D, the file will scroll but the cursor will come back to the first no-space character.

There's is an option to set to keep the cursor in the same column after a such scroll ?

I have the behavior with gvim on Window, vim on OpenVMS and Cygwin.

Regards

+5  A: 

Well, one easy way to do so is using the movement keys. For example, to go down 100 lines keeping the cursor at the same column: "100j"

Edit:

Alright, searching a little more to really find an answer to your question, there's an option to do exactly what you want:

:set nostartofline
skinp
You posted your answer 1-2 minutes after Phil. I had to choose. I choose the fastest.Thank you very much.
Luc M
+6  A: 
CTRL-E - scroll down
CTRL-Y - scroll up

100<CTRL-E> will scroll down 100 lines for example

If you like using PG-UP/PG-DOWN or CTRL-D etc. you can set the "nostartofline" option

:set nostartofline
Phil
+1  A: 

You should read the solution given in VimTips

Jérôme
+1  A: 

This might not suit your situation at all, but if it makes it easier to break the lines up you can break them at a certain character e.g. after ':'

:%s/:/\r&/g

Or every 80 characters

:%s/.\{80}/&\r/g
sparklewhiskers
I'll keep it in mind... Thanks
Luc M