39 votes
Accepted

What is the mnemonic for Ctrl-Y (in normal mode)?

Bill Joy and Mark Horton wrote in their original vi manual: If you want to see more of the file below where you are, you can hit ^E to expose one more line at the bottom of the screen, leaving the ...
Martin Tournoij's user avatar
32 votes
Accepted

Scroll a quarter (25%) of the screen up or down

Maybe ctrld and ctrlu could be what you are looking for. By default they move half of the screen. From :h CTRL-D: Scroll window Downwards in the buffer. The number of lines comes from the '...
statox's user avatar
  • 49.3k
26 votes
Accepted

How do I make Vim always display several lines after EOF?

You can use ctrlE to scroll down your file, when you are at the end of the file it will add "virtual" line so the last line of the file is not at the bottom of the windows. Additionally you can use ...
statox's user avatar
  • 49.3k
21 votes

What is the mnemonic for Ctrl-Y (in normal mode)?

I like to call <C-y> "Yester-line"™ like "Yesterday". Explaining it along with <C-e> rhymes, too. "Extra-line" and "Yester-line"™.
ddrscott's user avatar
  • 421
20 votes
Accepted

Turn off synchronous scrolling not caused by either scrollbind or diff

As Christian Brabandt suggested in a comment, this can be caused by the 'cursorbind' setting. From :help 'cursorbind': When this option is set, as the cursor in the current window moves other ...
9 votes
Accepted

Open file and scroll to bottom command line param?

The following works for me: vim log +$ The + bit tells vim to run a command after startup. The $ command moves to the last line in the file. Depending on your shell, you might need \ before the $ ...
John O'M.'s user avatar
  • 8,462
9 votes
Accepted

Why are my windows scrolling together?

As suggested by Christian Brabandt in the comments, this was caused by the 'cursorbind' setting. :help 'cursorbind': When this option is set, as the cursor in the current window moves other ...
9 votes

keep same column when navigating by pages?

In addition to setting virtualedit=all, :set nostartofline
garyjohn's user avatar
  • 6,284
8 votes

Scrolling down multiple lines with Ctrl+e

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....
Dan Jones's user avatar
7 votes

Scrolling down multiple lines with Ctrl+e

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 ...
tokoyami's user avatar
  • 915
7 votes
Accepted

Console vim(x): Can I map the scroll wheel to undo--redo?

it works for me: set mouse=a map <ScrollWheelUp> u map <ScrollWheelDown> <C-R> But i hope this is just for fun. Must be horrible =)
B.G.'s user avatar
  • 1,116
7 votes
Accepted

Scrollback in Vim 8 Terminal

See the option termwinscroll as documented at :help terminal-normal and :help termwinscroll. 'termwinscroll' 'twsl' number (default 10000) local to buffer {not in Vi} {not ...
Mass's user avatar
  • 13.9k
7 votes
Accepted

How to scroll in another window without switching to it?

scroll the view of the bottom window without switching to that window Something like this call win_execute(win_getid(winnr('j')), "normal! \<C-E>") winnr('j') returns Window number ...
Matt's user avatar
  • 20.4k
6 votes
Accepted

How to keep the screen position from "zt" after switching buffer

TL;DR use autocommands, see the end of this post. Here's the result of the investigation I've made: Calling bn call the ex_bnext function which does two things: Go to the desired buffer via the ...
nobe4's user avatar
  • 15.9k
6 votes

Scroll a quarter (25%) of the screen up or down

You can use ctrle and ctrly to move the page by one line up and down. Then if you want for +/- 25% to be moved you can use 20ctrle and that will move you 20 lines down. Here is also a good explained ...
A. Dziedziczak's user avatar
6 votes
Accepted

Can I scroll in vim with my touch screen?

Note: I have not tested this with gvim, only with normal vim This piece of code allows me to scroll instead of selecting text when I drag using my mouse. function! MouseScroll() "mark b is the ...
user41805's user avatar
  • 333
6 votes

Why isn't this implemented by default in vim? (line by line Scroll)

*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 ...
dedowsdi's user avatar
  • 6,188
6 votes
Accepted

Bottom Padding In Vim?

You may be looking for zz, zt, and zb—they center (or move to the top, or to the bottom) the current line on the screen.
D. Ben Knoble's user avatar
  • 25.3k
6 votes
Accepted

Scroll Lock in Vim

I think the best way to do what you want is to use ctrle to scroll up and ctrly to scroll down as the doc says: :h CTRL-E :h CTRL-Y However if you really want to use the arrow keys and have a scroll ...
statox's user avatar
  • 49.3k
5 votes

How to make horizontal scrolling easier when the cursor is not ideally located?

Just stumbled across this question/answer, and I think it's a terrific idea, with an ingenious solution! However, while I think the existing answer is very clever, something about it doesn't sit well ...
Rich's user avatar
  • 31.3k
5 votes

Scrolling down multiple lines with Ctrl+e

As others have noted, you can prefix both <C-e> and <C-y> with counts, to "expose" that many more lines up or down. Another handy quick scrolling option lets you scroll so that the ...
Wildcard's user avatar
  • 4,364
5 votes

How do I make Vim always display several lines after EOF?

In your config you can add zz to j and k. It has the major side effect of centering your cursor. I don't mind and much prefer it to craning my neck. I tried scrolloff and CTRL-E is just uncomfortable ...
hello's user avatar
  • 51
5 votes

How to scroll without forcing the cursor on screen (by letting the cursor off screen)?

I am used from other editors to use the cursor as a visual bookmark, so that after scrolling by letting the cursor off screen I can come back to its place later. If you're just scrolling through the ...
Alexander Batischev's user avatar
5 votes
Accepted

Visual scrolling/visual <C-e> and <C-y> across wrapped lines?

I've released a vim plugin that pretty closely matches this behavior. Instead of scrolling by exactly N lines, this maps <C-u>, <C-d> (half window) and <C-j>, <C-k> (quarter ...
Luke Davis's user avatar
  • 1,397
5 votes
Accepted

Can I use the mouse scroll wheel to browse the auto-completion popup menu?

Your examples work fine for me on Vim 7.4.1689 and Neovim. The following didn't work at first: set mouse=a Then I read the following in :h 'mouse' Enable the use of the mouse. Only works for ...
Tommy A's user avatar
  • 6,710
5 votes
Accepted

Keeping context while scrolling

I would simply use :rightbelow split.
Naumann's user avatar
  • 2,739
5 votes

keep same column when navigating by pages?

The relevant option is startofline. set nostartofline will prevent vim from moving to just after leading indentation after performing a motion like c-u, c-d, gg, G. I can confirm that it interacts ...
Greg Nisbet's user avatar
  • 1,839
5 votes

gvim Linux - GUI scroll without cursor shift

Vim doesn't remember where you've been in a file unless you made a change there (see :help changelist) or jumped there (see help jumplist). Also, Vim's cursor is always somewhere in a window, that is, ...
garyjohn's user avatar
  • 6,284
5 votes
Accepted

zt for horizontal scrolling

I think zs and ze may be helpful. Try help: zs help ze. zs zs Scroll the text horizontally to position the cursor ...
WW00WW's user avatar
  • 300
5 votes

How to scroll in another window without switching to it?

I use the mouse for this. With set mouse=a I can scroll any open window from any mode (including normal mode). It’s not the purest solution, but it works very well for me.
D. Ben Knoble's user avatar
  • 25.3k

Only top scored, non community-wiki answers of a minimum length are eligible