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 ...
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 '...
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 ...
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"™.
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 ...
Community wiki
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 $ ...
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 ...
Community wiki
9
votes
keep same column when navigating by pages?
In addition to setting virtualedit=all,
:set nostartofline
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....
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 ...
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 =)
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
5
votes
Accepted
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 ...
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, ...
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
...
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.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
scrolling × 108cursor-movement × 12
mouse × 12
key-bindings × 9
terminal × 8
vimrc × 7
gvim × 6
vim-windows × 6
cursor × 6
vimscript × 5
split × 5
neovim × 4
redraw × 4
autocmd × 3
macvim × 3
vimdiff × 3
wrapping × 3
navigation × 3
multiple-lines × 3
normal-mode × 2
folding × 2
formatting × 2
statusline × 2
undo-redo × 2
conceal × 2