0

I move around using the arrows ←↓↑→, never really got used to the hjkl thing. I know I'm supposed to use the hjkl thing.

When hitting ↓, it reaches a point where the caret is on the lower side of the display, until I hit some ↑ hits.

Most of the time I need more context down. How do you move the doc down while not moving the caret?

5

You're looking for :h 'scrolloff':

'scrolloff' 'so'    number  (default 0)
            global
    Minimal number of screen lines to keep above and below the cursor.

So you can add something like this in your .vimrc:

set scrolloff=10
  • By not moving the caret I didn't mean leave the caret in the same document line but leave the caret in the same terminal line. In :h scrolling CTRL-D matches, but defaults to half a screen and I need only one line. I read it can be feed a [count], but I didn't understand how to feed it. – uprego Apr 25 at 10:39
  • 1
    @uprego Oh you mean something like :h 'scrolloff' to always have some lines between the cursor and the border of the window? – statox Apr 25 at 11:43
2

You can also use CTRL-e and CTRL-y to move the view, while not moving the cursor.

At the end of your file, you can use CTRL-e until the last line of the document is at the first line of the page.

  • 2
    I shouldn't have edited my answer but that is what I first suggested to OP but they clarified that it wasn't what they were looking for. Anyway that's still two pretty useful commands. – statox Apr 26 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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