I know i can scroll down using ctrl+e and up using control ctrl+y. Any idea how I can scroll multiple lines with ctrl+e ? I am looking for a quick solution for scrolling down in vim ?
You can use a count before Ctrl-E −
15<C-e> moves down 15 lines. Ctrl-D moves down half a screen by default, although the amount it moves can be configured via the "scroll" option.
:help motion.txt will provide this and a whole lot more details.
Ctrl+e takes count, so the quick and simple way is to create a normal mode mapping like the following:
nnoremap <C-e> 10<C-e>
This will simply do Ctrl+e 10 times. You can change the number to the number of lines you want it to scroll at once.
It's important to note that the mapping is of the
noremap type. Otherwise VIm will enter an infinite loop once you press the combination.
As others have noted, you can prefix both
<C-y> with counts, to "expose" that many more lines up or down.
Another handy quick scrolling option lets you scroll so that the current line is at the top, middle, or bottom of your screen:
z<CR>- scroll so current line is at the top of your screen
z.- scroll so current line is in the middle of your screen
z-- scroll so current line is at the bottom of your screen
I find the above three versions easiest to type, but Vim does have counterparts for each that leave your cursor in the same column you started in:
zz(LOWERCASE) for middle
:help scroll-cursor for more.