/usr/share/vim/vim82/doc
NameSizeModeActions
arabic.txt119010644editdlrm
autocmd.txt722200644editdlrm
change.txt780490644editdlrm
channel.txt503090644editdlrm
cmdline.txt493420644editdlrm
debug.txt68960644editdlrm
debugger.txt54430644editdlrm
develop.txt228610644editdlrm
diff.txt170240644editdlrm
digraph.txt619780644editdlrm
editing.txt741610644editdlrm
eval.txt5412090644editdlrm
farsi.txt5230644editdlrm
filetype.txt275940644editdlrm
fold.txt236890644editdlrm
ft_ada.txt182460644editdlrm
ft_rust.txt95960644editdlrm
ft_sql.txt307000644editdlrm
gui.txt527410644editdlrm
gui_w32.txt194510644editdlrm
gui_x11.txt299060644editdlrm
hangulin.txt5980644editdlrm
hebrew.txt56660644editdlrm
help.txt88990644editdlrm
helphelp.txt157290644editdlrm
howto.txt29160644editdlrm
if_cscop.txt193250644editdlrm
if_lua.txt167550644editdlrm
if_mzsch.txt119410644editdlrm
if_ole.txt73610644editdlrm
if_perl.txt112810644editdlrm
if_pyth.txt384350644editdlrm
if_ruby.txt85160644editdlrm
if_sniff.txt2710644editdlrm
if_tcl.txt229510644editdlrm
indent.txt422840644editdlrm
index.txt806380644editdlrm
insert.txt852940644editdlrm
intro.txt389720644editdlrm
map.txt707990644editdlrm
mbyte.txt596420644editdlrm
message.txt314250644editdlrm
mlang.txt81870644editdlrm
motion.txt513410644editdlrm
netbeans.txt379820644editdlrm
options.txt3913080644editdlrm
os_390.txt47490644editdlrm
os_amiga.txt54660644editdlrm
os_beos.txt2930644editdlrm
os_dos.txt123780644editdlrm
os_haiku.txt85920644editdlrm
os_mac.txt68560644editdlrm
os_mint.txt3910644editdlrm
os_msdos.txt5230644editdlrm
os_os2.txt2990644editdlrm
os_qnx.txt40710644editdlrm
os_risc.txt3280644editdlrm
os_unix.txt26030644editdlrm
os_vms.txt329060644editdlrm
os_win32.txt133510644editdlrm
pattern.txt601370644editdlrm
pi_getscript.txt210820644editdlrm
pi_gzip.txt12940644editdlrm
pi_logipat.txt41960644editdlrm
pi_netrw.txt1792860644editdlrm
pi_paren.txt22740644editdlrm
pi_spec.txt41270644editdlrm
pi_tar.txt68130644editdlrm
pi_vimball.txt118590644editdlrm
pi_zip.txt72940644editdlrm
popup.txt394720644editdlrm
print.txt310250644editdlrm
quickfix.txt829250644editdlrm
quickref.txt721440644editdlrm
quotes.txt127480644editdlrm
recover.txt107200644editdlrm
remote.txt84170644editdlrm
repeat.txt421860644editdlrm
rileft.txt49380644editdlrm
russian.txt30240644editdlrm
scroll.txt137810644editdlrm
sign.txt258590644editdlrm
spell.txt640990644editdlrm
sponsor.txt72030644editdlrm
starting.txt735910644editdlrm
syntax.txt2258630644editdlrm
tabpage.txt172480644editdlrm
tags3548120644editdlrm
tagsrch.txt402780644editdlrm
term.txt474980644editdlrm
terminal.txt561000644editdlrm
testing.txt149540644editdlrm
textprop.txt134020644editdlrm
tips.txt210670644editdlrm
todo.txt3094200644editdlrm
uganda.txt140280644editdlrm
undo.txt165840644editdlrm
usr_01.txt70810644editdlrm
usr_02.txt242260644editdlrm
usr_03.txt238720644editdlrm
usr_04.txt191310644editdlrm
usr_05.txt270230644editdlrm
usr_06.txt96110644editdlrm
usr_07.txt159950644editdlrm
usr_08.txt193780644editdlrm
usr_09.txt115020644editdlrm
usr_10.txt292000644editdlrm
usr_11.txt130250644editdlrm
usr_12.txt134290644editdlrm
usr_20.txt137090644editdlrm
usr_21.txt184560644editdlrm
usr_22.txt149990644editdlrm
usr_23.txt127440644editdlrm
usr_24.txt208270644editdlrm
usr_25.txt191760644editdlrm
usr_26.txt82590644editdlrm
usr_27.txt177090644editdlrm
usr_28.txt160200644editdlrm
usr_29.txt201210644editdlrm
usr_30.txt226580644editdlrm
usr_31.txt103990644editdlrm
usr_32.txt53780644editdlrm
usr_40.txt231950644editdlrm
usr_41.txt973780644editdlrm
usr_42.txt138530644editdlrm
usr_43.txt74090644editdlrm
usr_44.txt289480644editdlrm
usr_45.txt176880644editdlrm
usr_46.txt70960644editdlrm
usr_90.txt168360644editdlrm
usr_toc.txt95050644editdlrm
various.txt310970644editdlrm
version4.txt139110644editdlrm
version5.txt3085320644editdlrm
version6.txt5769400644editdlrm
version7.txt6747010644editdlrm
version8.txt19403070644editdlrm
vim9.txt571580644editdlrm
visual.txt217940644editdlrm
vi_diff.txt574280644editdlrm
windows.txt557320644editdlrm
workshop.txt3710644editdlrm
Edit: /usr/share/vim/vim82/doc/scroll.txt (13781B)
*scroll.txt* For Vim version 8.2. Last change: 2019 May 13 VIM REFERENCE MANUAL by Bram Moolenaar Scrolling *scrolling* These commands move the contents of the window. If the cursor position is moved off of the window, the cursor is moved onto the window (with 'scrolloff' screen lines around it). A page is the number of lines in the window minus two. The mnemonics for these commands may be a bit confusing. Remember that the commands refer to moving the window (the part of the buffer that you see) upwards or downwards in the buffer. When the window moves upwards in the buffer, the text in the window moves downwards on your screen. See section |03.7| of the user manual for an introduction. 1. Scrolling downwards |scroll-down| 2. Scrolling upwards |scroll-up| 3. Scrolling relative to cursor |scroll-cursor| 4. Scrolling horizontally |scroll-horizontal| 5. Scrolling synchronously |scroll-binding| 6. Scrolling with a mouse wheel |scroll-mouse-wheel| ============================================================================== 1. Scrolling downwards *scroll-down* The following commands move the edit window (the part of the buffer that you see) downwards (this means that more lines downwards in the text buffer can be seen): *CTRL-E* CTRL-E Scroll window [count] lines downwards in the buffer. The text moves upwards on the screen. Mnemonic: Extra lines. *CTRL-D* CTRL-D Scroll window Downwards in the buffer. The number of lines comes from the 'scroll' option (default: half a screen). If [count] given, first set 'scroll' option to [count]. The cursor is moved the same number of lines down in the file (if possible; when lines wrap and when hitting the end of the file there may be a difference). When the cursor is on the last line of the buffer nothing happens and a beep is produced. See also 'startofline' option. or ** ** or ** *CTRL-F* CTRL-F Scroll window [count] pages Forwards (downwards) in the buffer. See also 'startofline' option. When there is only one window the 'window' option might be used. *z+* z+ Without [count]: Redraw with the line just below the window at the top of the window. Put the cursor in that line, at the first non-blank in the line. With [count]: just like "z". ============================================================================== 2. Scrolling upwards *scroll-up* The following commands move the edit window (the part of the buffer that you see) upwards (this means that more lines upwards in the text buffer can be seen): *CTRL-Y* CTRL-Y Scroll window [count] lines upwards in the buffer. The text moves downwards on the screen. Note: When using the MS-Windows key bindings CTRL-Y is remapped to redo. *CTRL-U* CTRL-U Scroll window Upwards in the buffer. The number of lines comes from the 'scroll' option (default: half a screen). If [count] given, first set the 'scroll' option to [count]. The cursor is moved the same number of lines up in the file (if possible; when lines wrap and when hitting the end of the file there may be a difference). When the cursor is on the first line of the buffer nothing happens and a beep is produced. See also 'startofline' option. or ** ** or ** *CTRL-B* CTRL-B Scroll window [count] pages Backwards (upwards) in the buffer. See also 'startofline' option. When there is only one window the 'window' option might be used. *z^* z^ Without [count]: Redraw with the line just above the window at the bottom of the window. Put the cursor in that line, at the first non-blank in the line. With [count]: First scroll the text to put the [count] line at the bottom of the window, then redraw with the line which is now at the top of the window at the bottom of the window. Put the cursor in that line, at the first non-blank in the line. ============================================================================== 3. Scrolling relative to cursor *scroll-cursor* The following commands reposition the edit window (the part of the buffer that you see) while keeping the cursor on the same line. Note that the 'scrolloff' option may cause context lines to show above and below the cursor. *z* z Redraw, line [count] at top of window (default cursor line). Put cursor at first non-blank in the line. *zt* zt Like "z", but leave the cursor in the same column. *zN* z{height} Redraw, make window {height} lines tall. This is useful to make the number of lines small when screen updating is very slow. Cannot make the height more than the physical screen height. *z.* z. Redraw, line [count] at center of window (default cursor line). Put cursor at first non-blank in the line. *zz* zz Like "z.", but leave the cursor in the same column. Careful: If caps-lock is on, this command becomes "ZZ": write buffer and exit! *z-* z- Redraw, line [count] at bottom of window (default cursor line). Put cursor at first non-blank in the line. *zb* zb Like "z-", but leave the cursor in the same column. ============================================================================== 4. Scrolling horizontally *scroll-horizontal* For the following four commands the cursor follows the screen. If the character that the cursor is on is moved off the screen, the cursor is moved to the closest character that is on the screen. The value of 'sidescroll' is not used. z or *zl* *z* zl Move the view on the text [count] characters to the right, thus scroll the text [count] characters to the left. This only works when 'wrap' is off. z or *zh* *z* zh Move the view on the text [count] characters to the left, thus scroll the text [count] characters to the right. This only works when 'wrap' is off. *zL* zL Move the view on the text half a screenwidth to the right, thus scroll the text half a screenwidth to the left. This only works when 'wrap' is off. *zH* zH Move the view on the text half a screenwidth to the left, thus scroll the text half a screenwidth to the right. This only works when 'wrap' is off. For the following two commands the cursor is not moved in the text, only the text scrolls on the screen. *zs* zs Scroll the text horizontally to position the cursor at the start (left side) of the screen. This only works when 'wrap' is off. *ze* ze Scroll the text horizontally to position the cursor at the end (right side) of the screen. This only works when 'wrap' is off. ============================================================================== 5. Scrolling synchronously *scroll-binding* Occasionally, it is desirable to bind two or more windows together such that when one window is scrolled, the other windows are also scrolled. In Vim, windows can be given this behavior by setting the (window-specific) 'scrollbind' option. When a window that has 'scrollbind' set is scrolled, all other 'scrollbind' windows are scrolled the same amount, if possible. The behavior of 'scrollbind' can be modified by the 'scrollopt' option. When using the scrollbars, the binding only happens when scrolling the window with focus (where the cursor is). You can use this to avoid scroll-binding for a moment without resetting options. When a window also has the 'diff' option set, the scroll-binding uses the differences between the two buffers to synchronize the position precisely. Otherwise the following method is used. *scrollbind-relative* Each 'scrollbind' window keeps track of its "relative offset," which can be thought of as the difference between the current window's vertical scroll position and the other window's vertical scroll position. When one of the 'scrollbind' windows is asked to vertically scroll past the beginning or end limit of its text, the window no longer scrolls, but remembers how far past the limit it wishes to be. The window keeps this information so that it can maintain the same relative offset, regardless of its being asked to scroll past its buffer's limits. However, if a 'scrollbind' window that has a relative offset that is past its buffer's limits is given the cursor focus, the other 'scrollbind' windows must jump to a location where the current window's relative offset is valid. This behavior can be changed by clearing the "jump" flag from the 'scrollopt' option. *syncbind* *:syncbind* *:sync* :syncbind Force all 'scrollbind' windows to have the same relative offset. I.e., when any of the 'scrollbind' windows is scrolled to the top of its buffer, all of the 'scrollbind' windows will also be at the top of their buffers. *scrollbind-quickadj* The 'scrollbind' flag is meaningful when using keyboard commands to vertically scroll a window, and also meaningful when using the vertical scrollbar of the window which has the cursor focus. However, when using the vertical scrollbar of a window which doesn't have the cursor focus, 'scrollbind' is ignored. This allows quick adjustment of the relative offset of 'scrollbind' windows. ============================================================================== 6. Scrolling with a mouse wheel *scroll-mouse-wheel* When your mouse has a scroll wheel, it should work with Vim in the GUI. How it works depends on your system. It might also work in an xterm |xterm-mouse-wheel|. By default only vertical scroll wheels are supported, but some GUIs also support horizontal scroll wheels. For the Win32 GUI the scroll action is hard coded. It works just like dragging the scrollbar of the current window. How many lines are scrolled depends on your mouse driver. If the scroll action causes input focus problems, see |intellimouse-wheel-problems|. For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key presses , , and . For example, if you push the scroll wheel upwards a key press is generated causing the window to scroll upwards (while the text is actually moving downwards). The default action for these keys are: scroll three lines up ** scroll one page up ** scroll one page up ** scroll three lines down ** scroll one page down ** scroll one page down ** scroll six columns left ** scroll one page left ** scroll one page left ** scroll six columns right ** scroll one page right ** scroll one page right ** This should work in all modes, except when editing the command line. Note that horizontal scrolling only works if 'nowrap' is set. Also, unless the "h" flag in 'guioptions' is set, the cursor moves to the longest visible line if the cursor line is about to be scrolled off the screen (similarly to how the horizontal scrollbar works). You can modify the default behavior by mapping the keys. For example, to make the scroll wheel move one line or half a page in Normal mode: > :map :map :map :map You can also use Alt and Ctrl modifiers. This only works when Vim gets the scroll wheel events, of course. You can check if this works with the "xev" program. When using XFree86, the /etc/XF86Config file should have the correct entry for your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: > Protocol "MouseMan" Device "/dev/psm0" ZAxisMapping 4 5 See the XFree86 documentation for information. ** ** The keys and have been deprecated. Use instead of and use instead of . *xterm-mouse-wheel* To use the mouse wheel in a new xterm you only have to make the scroll wheel work in your Xserver, as mentioned above. To use the mouse wheel in an older xterm you must do this: 1. Make it work in your Xserver, as mentioned above. 2. Add translations for the xterm, so that the xterm will pass a scroll event to Vim as an escape sequence. 3. Add mappings in Vim, to interpret the escape sequences as or keys. You can do the translations by adding this to your ~.Xdefaults file (or other file where your X resources are kept): > XTerm*VT100.Translations: #override \n\ s: string("0x9b") string("[64~") \n\ s: string("0x9b") string("[65~") \n\ : string("0x9b") string("[62~") \n\ : string("0x9b") string("[63~") \n\ : \n\ : Add these mappings to your vimrc file: > :map [62~ :map! [62~ :map [63~ :map! [63~ :map [64~ :map! [64~ :map [65~ :map! [65~ < vim:tw=78:ts=8:noet:ft=help:norl: