How may I scroll with vim into a big file?

Luc M picture Luc M · Feb 18, 2009 · Viewed 16.9k times · Source

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.

Answer

Philip Reynolds picture Philip Reynolds · Feb 18, 2009
CTRL-E - scroll down
CTRL-Y - scroll up

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

If you like using PageUp, PageDown or Ctrl+D etc. you can set the "nostartofline" option

:set nostartofline