New answers tagged

4

Most likely the developer didn't feel that this feature is important enough to deserve a simple key. On the other hand it is possible to create mappings using 1<C-d> and 1<C-u> when you need it. Remember that vi was initially implemented by Billy Joy in 1976. At that time scrolling the screen might have been an expensive operation.


6

*CTRL-D* CTRL-D Scroll window Downwards in the buffer. The number of lines comes from the 'scroll' option (default: half a screen). <b>If [count] given, first set 'scroll' option to [count].</b> ... Execute 1<ctrl-d> for one time, it will set 'scroll' to 1, you can then use <c-d> and &...


2

This is essentially packing @Rich's solution (temporarily setting 'scrolloff') into a function, to improve readability. I'm also defining a command and a mapping with a little bit more of flexibility (allowing a custom offset to be specified through a "count") and usability. function! ScrollOffset(offset) let save_scrolloff = &l:scrolloff let &...


2

The brute force way to do it: :let scrolloff_before = &scrolloff | set scrolloff=10 | redraw | let &scrolloff = scrolloff_before | unlet scrolloff_before This works by saving the current 'scrolloff' value in a variable, setting it to 10, redrawing the screen so the update is applied (which is necessary because we are running all the commands in a ...


Top 50 recent answers are included