代码拉取完成,页面将自动刷新
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>scroll - Vim Documentation</title>
<meta name="Generator" content="Vim/8.0">
<meta name="plugin-version" content="vim8.0">
<meta name="syntax" content="help">
<meta name="settings" content="no_pre,use_css,expand_tabs">
<link rel="stylesheet" href="style.css" type="text/css" />
<script src="jquery.min.js" type="text/javascript"></script>
<script src="mark-current-page.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="header">
<a href="http://vim-jp.org/">vim-jp</a>
/ <a href="http://vim-jp.org/vimdoc-en/">vimdoc-en</a>
/ scroll<br />
<a name="top"></a><h1>scroll - Vim Documentation</h1>
<a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
</div>
</header>
<nav>
<dl>
<dt>BASIC</dt>
<dd><ul>
<li><a href="quickref.html">quickref</a></li>
<li><a href="sponsor.html">sponsor</a></li>
</ul></dd>
<dt>USER MANUAL</dt>
<dd><ul>
<li><a href="usr_toc.html">usr_toc</a></li>
</ul></dd>
<dt>Getting Started</dt>
<dd><ul>
<li><a href="usr_01.html">usr_01</a></li>
<li><a href="usr_02.html">usr_02</a></li>
<li><a href="usr_03.html">usr_03</a></li>
<li><a href="usr_04.html">usr_04</a></li>
<li><a href="usr_05.html">usr_05</a></li>
<li><a href="usr_06.html">usr_06</a></li>
<li><a href="usr_07.html">usr_07</a></li>
<li><a href="usr_08.html">usr_08</a></li>
<li><a href="usr_09.html">usr_09</a></li>
<li><a href="usr_10.html">usr_10</a></li>
<li><a href="usr_11.html">usr_11</a></li>
<li><a href="usr_12.html">usr_12</a></li>
</ul></dd>
<dt>Editing Effectively</dt>
<dd><ul>
<li><a href="usr_20.html">usr_20</a></li>
<li><a href="usr_21.html">usr_21</a></li>
<li><a href="usr_22.html">usr_22</a></li>
<li><a href="usr_23.html">usr_23</a></li>
<li><a href="usr_24.html">usr_24</a></li>
<li><a href="usr_25.html">usr_25</a></li>
<li><a href="usr_26.html">usr_26</a></li>
<li><a href="usr_27.html">usr_27</a></li>
<li><a href="usr_28.html">usr_28</a></li>
<li><a href="usr_29.html">usr_29</a></li>
<li><a href="usr_30.html">usr_30</a></li>
<li><a href="usr_31.html">usr_31</a></li>
<li><a href="usr_32.html">usr_32</a></li>
</ul></dd>
<dt>Tuning Vim</dt>
<dd><ul>
<li><a href="usr_40.html">usr_40</a></li>
<li><a href="usr_41.html">usr_41</a></li>
<li><a href="usr_42.html">usr_42</a></li>
<li><a href="usr_43.html">usr_43</a></li>
<li><a href="usr_44.html">usr_44</a></li>
<li><a href="usr_45.html">usr_45</a></li>
</ul></dd>
<dt>Making Vim Run</dt>
<dd><ul>
<li><a href="usr_90.html">usr_90</a></li>
</ul></dd>
<dt>General subjects</dt>
<dd><ul>
<li><a href="intro.html">intro</a></li>
<li><a href="index.html">help</a></li>
<li><a href="helphelp.html">helphelp</a></li>
<li><a href="vimindex.html">index</a></li>
<li><a href="tags.html">tags</a></li>
<li><a href="howto.html">howto</a></li>
<li><a href="tips.html">tips</a></li>
<li><a href="message.html">message</a></li>
<li><a href="quotes.html">quotes</a></li>
<li><a href="todo.html">todo</a></li>
<li><a href="debug.html">debug</a></li>
<li><a href="develop.html">develop</a></li>
<li><a href="uganda.html">uganda</a></li>
</ul></dd>
<dt>Basic editing</dt>
<dd><ul>
<li><a href="starting.html">starting</a></li>
<li><a href="editing.html">editing</a></li>
<li><a href="motion.html">motion</a></li>
<li><a href="scroll.html">scroll</a></li>
<li><a href="insert.html">insert</a></li>
<li><a href="change.html">change</a></li>
<li><a href="indent.html">indent</a></li>
<li><a href="undo.html">undo</a></li>
<li><a href="repeat.html">repeat</a></li>
<li><a href="visual.html">visual</a></li>
<li><a href="various.html">various</a></li>
<li><a href="recover.html">recover</a></li>
</ul></dd>
<dt>Advanced editing</dt>
<dd><ul>
<li><a href="cmdline.html">cmdline</a></li>
<li><a href="options.html">options</a></li>
<li><a href="pattern.html">pattern</a></li>
<li><a href="map.html">map</a></li>
<li><a href="tagsrch.html">tagsrch</a></li>
<li><a href="quickfix.html">quickfix</a></li>
<li><a href="windows.html">windows</a></li>
<li><a href="tabpage.html">tabpage</a></li>
<li><a href="syntax.html">syntax</a></li>
<li><a href="spell.html">spell</a></li>
<li><a href="diff.html">diff</a></li>
<li><a href="autocmd.html">autocmd</a></li>
<li><a href="filetype.html">filetype</a></li>
<li><a href="eval.html">eval</a></li>
<li><a href="channel.html">channel</a></li>
<li><a href="fold.html">fold</a></li>
</ul></dd>
<dt>Special issues</dt>
<dd><ul>
<li><a href="print.html">print</a></li>
<li><a href="remote.html">remote</a></li>
<li><a href="term.html">term</a></li>
<li><a href="digraph.html">digraph</a></li>
<li><a href="mbyte.html">mbyte</a></li>
<li><a href="mlang.html">mlang</a></li>
<li><a href="arabic.html">arabic</a></li>
<li><a href="farsi.html">farsi</a></li>
<li><a href="hebrew.html">hebrew</a></li>
<li><a href="russian.html">russian</a></li>
<li><a href="ft_ada.html">ft_ada</a></li>
<li><a href="ft_sql.html">ft_sql</a></li>
<li><a href="hangulin.html">hangulin</a></li>
<li><a href="rileft.html">rileft</a></li>
</ul></dd>
<dt>GUI</dt>
<dd><ul>
<li><a href="gui.html">gui</a></li>
<li><a href="gui_w32.html">gui_w32</a></li>
<li><a href="gui_x11.html">gui_x11</a></li>
</ul></dd>
<dt>Interfaces</dt>
<dd><ul>
<li><a href="if_cscop.html">if_cscop</a></li>
<li><a href="if_lua.html">if_lua</a></li>
<li><a href="if_mzsch.html">if_mzsch</a></li>
<li><a href="if_perl.html">if_perl</a></li>
<li><a href="if_pyth.html">if_pyth</a></li>
<li><a href="if_tcl.html">if_tcl</a></li>
<li><a href="if_ole.html">if_ole</a></li>
<li><a href="if_ruby.html">if_ruby</a></li>
<li><a href="debugger.html">debugger</a></li>
<li><a href="workshop.html">workshop</a></li>
<li><a href="netbeans.html">netbeans</a></li>
<li><a href="sign.html">sign</a></li>
</ul></dd>
<dt>Versions</dt>
<dd><ul>
<li><a href="vi_diff.html">vi_diff</a></li>
<li><a href="version4.html">version4</a></li>
<li><a href="version5.html">version5</a></li>
<li><a href="version6.html">version6</a></li>
<li><a href="version7.html">version7</a></li>
<li><a href="version8.html">version8</a></li>
</ul></dd>
<dt>Remarks about specific systems</dt>
<dd><ul>
<li><a href="os_390.html">os_390</a></li>
<li><a href="os_amiga.html">os_amiga</a></li>
<li><a href="os_beos.html">os_beos</a></li>
<li><a href="os_dos.html">os_dos</a></li>
<li><a href="os_mac.html">os_mac</a></li>
<li><a href="os_mint.html">os_mint</a></li>
<li><a href="os_msdos.html">os_msdos</a></li>
<li><a href="os_os2.html">os_os2</a></li>
<li><a href="os_qnx.html">os_qnx</a></li>
<li><a href="os_risc.html">os_risc</a></li>
<li><a href="os_unix.html">os_unix</a></li>
<li><a href="os_vms.html">os_vms</a></li>
<li><a href="os_win32.html">os_win32</a></li>
</ul></dd>
<dt>Standard plugins</dt>
<dd><ul>
<li><a href="pi_getscript.html">pi_getscript</a></li>
<li><a href="pi_gzip.html">pi_gzip</a></li>
<li><a href="pi_logipat.html">pi_logipat</a></li>
<li><a href="pi_netrw.html">pi_netrw</a></li>
<li><a href="pi_paren.html">pi_paren</a></li>
<li><a href="pi_tar.html">pi_tar</a></li>
<li><a href="pi_vimball.html">pi_vimball</a></li>
<li><a href="pi_zip.html">pi_zip</a></li>
</ul></dd>
<dt>Filetype plugins</dt>
<dd><ul>
<li><a href="pi_spec.html">pi_spec</a></li>
</ul></dd>
<dt>Others</dt>
<dd><ul>
<li><a href="vim_faq.html">vim_faq</a></li>
</ul></dd>
</dl>
</nav>
<article class="Vimdoc VimdocJa">
<div id='vimCodeElement'>
<a class="Constant" href="scroll.html" name="scroll.txt">scroll.txt</a> For <span class="Identifier">Vim version 8.0.</span> Last change: 2016 Nov 10<br>
<br>
<br>
<span class="Identifier">VIM REFERENCE MANUAL by Bram Moolenaar</span><br>
<br>
<br>
Scrolling <a class="Constant" href="scroll.html#scrolling" name="scrolling">scrolling</a><br>
<br>
These commands move the contents of the window. If the cursor position is<br>
moved off of the window, the cursor is moved onto the window (with<br>
<a class="Type" href="options.html#'scrolloff'">'scrolloff'</a> screen lines around it). A page is the number of lines in the<br>
window minus two. The mnemonics for these commands may be a bit confusing.<br>
Remember that the commands refer to moving the window (the part of the buffer<br>
that you see) upwards or downwards in the buffer. When the window moves<br>
upwards in the buffer, the text in the window moves downwards on your screen.<br>
<br>
See section <a class="Identifier" href="usr_03.html#03.7">03.7</a> of the user manual for an introduction.<br>
<br>
1. Scrolling downwards <a class="Identifier" href="scroll.html#scroll-down">scroll-down</a><br>
2. Scrolling upwards <a class="Identifier" href="scroll.html#scroll-up">scroll-up</a><br>
3. Scrolling relative to cursor <a class="Identifier" href="scroll.html#scroll-cursor">scroll-cursor</a><br>
4. Scrolling horizontally <a class="Identifier" href="scroll.html#scroll-horizontal">scroll-horizontal</a><br>
5. Scrolling synchronously <a class="Identifier" href="scroll.html#scroll-binding">scroll-binding</a><br>
6. Scrolling with a mouse wheel <a class="Identifier" href="scroll.html#scroll-mouse-wheel">scroll-mouse-wheel</a><br>
<br>
<span class="PreProc">==============================================================================</span><br>
1. Scrolling downwards <a class="Constant" href="scroll.html#scroll-down" name="scroll-down">scroll-down</a><br>
<br>
The following commands move the edit window (the part of the buffer that you<br>
see) downwards (this means that more lines downwards in the text buffer can be<br>
seen):<br>
<br>
<a class="Constant" href="scroll.html#CTRL-E" name="CTRL-E">CTRL-E</a><br>
<span class="Special">CTRL-E</span> Scroll window <span class="Special">[count]</span> lines downwards in the buffer.<br>
Mnemonic: Extra lines.<br>
<br>
<a class="Constant" href="scroll.html#CTRL-D" name="CTRL-D">CTRL-D</a><br>
<span class="Special">CTRL-D</span> Scroll window Downwards in the buffer. The number of<br>
lines comes from the <a class="Type" href="options.html#'scroll'">'scroll'</a> option (default: half a<br>
screen). If <span class="Special">[count]</span> given, first set <a class="Type" href="options.html#'scroll'">'scroll'</a> option<br>
to <span class="Special">[count]</span>. The cursor is moved the same number of<br>
lines down in the file (if possible; when lines wrap<br>
and when hitting the end of the file there may be a<br>
difference). When the cursor is on the last line of<br>
the buffer nothing happens and a beep is produced.<br>
See also <a class="Type" href="options.html#'startofline'">'startofline'</a> option.<br>
{difference from vi: Vim scrolls <a class="Type" href="options.html#'scroll'">'scroll'</a> screen<br>
lines, instead of file lines; makes a difference when<br>
lines wrap}<br>
<br>
<span class="Special"><S-Down></span> or <a class="Constant" href="scroll.html#<S-Down>" name="<S-Down>"><S-Down></a> <a class="Constant" href="scroll.html#<kPageDown>" name="<kPageDown>"><kPageDown></a><br>
<span class="Special"><PageDown></span> or <a class="Constant" href="scroll.html#<PageDown>" name="<PageDown>"><PageDown></a> <a class="Constant" href="scroll.html#CTRL-F" name="CTRL-F">CTRL-F</a><br>
<span class="Special">CTRL-F</span> Scroll window <span class="Special">[count]</span> pages Forwards (downwards) in<br>
the buffer. See also <a class="Type" href="options.html#'startofline'">'startofline'</a> option.<br>
When there is only one window the <a class="Type" href="options.html#'window'">'window'</a> option<br>
might be used.<br>
<br>
<a class="Constant" href="scroll.html#z+" name="z+">z+</a><br>
z+ Without <span class="Special">[count]</span>: Redraw with the line just below the<br>
window at the top of the window. Put the cursor in<br>
that line, at the first non-blank in the line.<br>
With <span class="Special">[count]</span>: just like "z<span class="Special"><CR></span>".<br>
<br>
<span class="PreProc">==============================================================================</span><br>
2. Scrolling upwards <a class="Constant" href="scroll.html#scroll-up" name="scroll-up">scroll-up</a><br>
<br>
The following commands move the edit window (the part of the buffer that you<br>
see) upwards (this means that more lines upwards in the text buffer can be<br>
seen):<br>
<br>
<a class="Constant" href="scroll.html#CTRL-Y" name="CTRL-Y">CTRL-Y</a><br>
<span class="Special">CTRL-Y</span> Scroll window <span class="Special">[count]</span> lines upwards in the buffer.<br>
<span class="Todo">Note</span>: When using the MS-Windows key bindings <span class="Special">CTRL-Y</span> is<br>
remapped to redo.<br>
<br>
<a class="Constant" href="scroll.html#CTRL-U" name="CTRL-U">CTRL-U</a><br>
<span class="Special">CTRL-U</span> Scroll window Upwards in the buffer. The number of<br>
lines comes from the <a class="Type" href="options.html#'scroll'">'scroll'</a> option (default: half a<br>
screen). If <span class="Special">[count]</span> given, first set the <a class="Type" href="options.html#'scroll'">'scroll'</a><br>
option to <span class="Special">[count]</span>. The cursor is moved the same<br>
number of lines up in the file (if possible; when<br>
lines wrap and when hitting the end of the file there<br>
may be a difference). When the cursor is on the first<br>
line of the buffer nothing happens and a beep is<br>
produced. See also <a class="Type" href="options.html#'startofline'">'startofline'</a> option.<br>
{difference from vi: Vim scrolls <a class="Type" href="options.html#'scroll'">'scroll'</a> screen<br>
lines, instead of file lines; makes a difference when<br>
lines wrap}<br>
<br>
<span class="Special"><S-Up></span> or <a class="Constant" href="scroll.html#<S-Up>" name="<S-Up>"><S-Up></a> <a class="Constant" href="scroll.html#<kPageUp>" name="<kPageUp>"><kPageUp></a><br>
<span class="Special"><PageUp></span> or <a class="Constant" href="scroll.html#<PageUp>" name="<PageUp>"><PageUp></a> <a class="Constant" href="scroll.html#CTRL-B" name="CTRL-B">CTRL-B</a><br>
<span class="Special">CTRL-B</span> Scroll window <span class="Special">[count]</span> pages Backwards (upwards) in the<br>
buffer. See also <a class="Type" href="options.html#'startofline'">'startofline'</a> option.<br>
When there is only one window the <a class="Type" href="options.html#'window'">'window'</a> option<br>
might be used.<br>
<br>
<a class="Constant" href="scroll.html#z^" name="z^">z^</a><br>
z^ Without <span class="Special">[count]</span>: Redraw with the line just above the<br>
window at the bottom of the window. Put the cursor in<br>
that line, at the first non-blank in the line.<br>
With <span class="Special">[count]</span>: First scroll the text to put the <span class="Special">[count]</span><br>
line at the bottom of the window, then redraw with the<br>
line which is now at the top of the window at the<br>
bottom of the window. Put the cursor in that line, at<br>
the first non-blank in the line.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
3. Scrolling relative to cursor <a class="Constant" href="scroll.html#scroll-cursor" name="scroll-cursor">scroll-cursor</a><br>
<br>
The following commands reposition the edit window (the part of the buffer that<br>
you see) while keeping the cursor on the same line. <span class="Todo">Note</span> that the <a class="Type" href="options.html#'scrolloff'">'scrolloff'</a><br>
option may cause context lines to show above and below the cursor.<br>
<br>
<a class="Constant" href="scroll.html#z<CR>" name="z<CR>">z<CR></a><br>
z<span class="Special"><CR></span> Redraw, line <span class="Special">[count]</span> at top of window (default<br>
cursor line). Put cursor at first non-blank in the<br>
line.<br>
<br>
<a class="Constant" href="scroll.html#zt" name="zt">zt</a><br>
zt Like "z<span class="Special"><CR></span>", but leave the cursor in the same<br>
column. <span class="Special">{not in Vi}</span><br>
<br>
<a class="Constant" href="scroll.html#zN<CR>" name="zN<CR>">zN<CR></a><br>
z<span class="Special">{height}<CR></span> Redraw, make window <span class="Special">{height}</span> lines tall. This is<br>
useful to make the number of lines small when screen<br>
updating is very slow. Cannot make the height more<br>
than the physical screen height.<br>
<br>
<a class="Constant" href="scroll.html#z." name="z.">z.</a><br>
z. Redraw, line <span class="Special">[count]</span> at center of window (default<br>
cursor line). Put cursor at first non-blank in the<br>
line.<br>
<br>
<a class="Constant" href="scroll.html#zz" name="zz">zz</a><br>
zz Like "z.", but leave the cursor in the same column.<br>
Careful: If caps-lock is on, this command becomes<br>
"ZZ": write buffer and exit! <span class="Special">{not in Vi}</span><br>
<br>
<a class="Constant" href="scroll.html#z-" name="z-">z-</a><br>
z- Redraw, line <span class="Special">[count]</span> at bottom of window (default<br>
cursor line). Put cursor at first non-blank in the<br>
line.<br>
<br>
<a class="Constant" href="scroll.html#zb" name="zb">zb</a><br>
zb Like "z-", but leave the cursor in the same column.<br>
<span class="Special">{not in Vi}</span><br>
<br>
<span class="PreProc">==============================================================================</span><br>
4. Scrolling horizontally <a class="Constant" href="scroll.html#scroll-horizontal" name="scroll-horizontal">scroll-horizontal</a><br>
<br>
For the following four commands the cursor follows the screen. If the<br>
character that the cursor is on is moved off the screen, the cursor is moved<br>
to the closest character that is on the screen. The value of <a class="Type" href="options.html#'sidescroll'">'sidescroll'</a> is<br>
not used.<br>
<br>
z<span class="Special"><Right></span> or <a class="Constant" href="scroll.html#zl" name="zl">zl</a> <a class="Constant" href="scroll.html#z<Right>" name="z<Right>">z<Right></a><br>
zl Move the view on the text <span class="Special">[count]</span> characters to the<br>
right, thus scroll the text <span class="Special">[count]</span> characters to the<br>
left. This only works when <a class="Type" href="options.html#'wrap'">'wrap'</a> is off. <span class="Special">{not in</span><br>
<span class="Special">Vi}</span><br>
<br>
z<span class="Special"><Left></span> or <a class="Constant" href="scroll.html#zh" name="zh">zh</a> <a class="Constant" href="scroll.html#z<Left>" name="z<Left>">z<Left></a><br>
zh Move the view on the text <span class="Special">[count]</span> characters to the<br>
left, thus scroll the text <span class="Special">[count]</span> characters to the<br>
right. This only works when <a class="Type" href="options.html#'wrap'">'wrap'</a> is off. <span class="Special">{not in</span><br>
<span class="Special">Vi}</span><br>
<br>
<a class="Constant" href="scroll.html#zL" name="zL">zL</a><br>
zL Move the view on the text half a screenwidth to the<br>
right, thus scroll the text half a screenwidth to the<br>
left. This only works when <a class="Type" href="options.html#'wrap'">'wrap'</a> is off. <span class="Special">{not in</span><br>
<span class="Special">Vi}</span><br>
<br>
<a class="Constant" href="scroll.html#zH" name="zH">zH</a><br>
zH Move the view on the text half a screenwidth to the<br>
left, thus scroll the text half a screenwidth to the<br>
right. This only works when <a class="Type" href="options.html#'wrap'">'wrap'</a> is off. <span class="Special">{not in</span><br>
<span class="Special">Vi}</span><br>
<br>
For the following two commands the cursor is not moved in the text, only the<br>
text scrolls on the screen.<br>
<br>
<a class="Constant" href="scroll.html#zs" name="zs">zs</a><br>
zs Scroll the text horizontally to position the cursor<br>
at the start (left side) of the screen. This only<br>
works when <a class="Type" href="options.html#'wrap'">'wrap'</a> is off. <span class="Special">{not in Vi}</span><br>
<br>
<a class="Constant" href="scroll.html#ze" name="ze">ze</a><br>
ze Scroll the text horizontally to position the cursor<br>
at the end (right side) of the screen. This only<br>
works when <a class="Type" href="options.html#'wrap'">'wrap'</a> is off. <span class="Special">{not in Vi}</span><br>
<br>
<span class="PreProc">==============================================================================</span><br>
5. Scrolling synchronously <a class="Constant" href="scroll.html#scroll-binding" name="scroll-binding">scroll-binding</a><br>
<br>
Occasionally, it is desirable to bind two or more windows together such that<br>
when one window is scrolled, the other windows are also scrolled. In Vim,<br>
windows can be given this behavior by setting the (window-specific)<br>
<a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> option. When a window that has <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> set is scrolled, all<br>
other <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> windows are scrolled the same amount, if possible. The<br>
behavior of <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> can be modified by the <a class="Type" href="options.html#'scrollopt'">'scrollopt'</a> option.<br>
<br>
When using the scrollbars, the binding only happens when scrolling the window<br>
with focus (where the cursor is). You can use this to avoid scroll-binding<br>
for a moment without resetting options.<br>
<br>
When a window also has the <a class="Type" href="options.html#'diff'">'diff'</a> option set, the scroll-binding uses the<br>
differences between the two buffers to synchronize the position precisely.<br>
Otherwise the following method is used.<br>
<br>
<a class="Constant" href="scroll.html#scrollbind-relative" name="scrollbind-relative">scrollbind-relative</a><br>
Each <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> window keeps track of its "relative offset," which can be<br>
thought of as the difference between the current window's vertical scroll<br>
position and the other window's vertical scroll position. When one of the<br>
<a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> windows is asked to vertically scroll past the beginning or end<br>
limit of its text, the window no longer scrolls, but remembers how far past<br>
the limit it wishes to be. The window keeps this information so that it can<br>
maintain the same relative offset, regardless of its being asked to scroll<br>
past its buffer's limits.<br>
<br>
However, if a <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> window that has a relative offset that is past its<br>
buffer's limits is given the cursor focus, the other <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> windows must<br>
jump to a location where the current window's relative offset is valid. This<br>
behavior can be changed by clearing the "jump" flag from the <a class="Type" href="options.html#'scrollopt'">'scrollopt'</a><br>
option.<br>
<br>
<a class="Constant" href="scroll.html#syncbind" name="syncbind">syncbind</a> <a class="Constant" href="scroll.html#:syncbind" name=":syncbind">:syncbind</a> <a class="Constant" href="scroll.html#:sync" name=":sync">:sync</a><br>
:syncbind Force all <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> windows to have the same<br>
relative offset. I.e., when any of the <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a><br>
windows is scrolled to the top of its buffer, all of<br>
the <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> windows will also be at the top of<br>
their buffers.<br>
<br>
<a class="Constant" href="scroll.html#scrollbind-quickadj" name="scrollbind-quickadj">scrollbind-quickadj</a><br>
The <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> flag is meaningful when using keyboard commands to vertically<br>
scroll a window, and also meaningful when using the vertical scrollbar of the<br>
window which has the cursor focus. However, when using the vertical scrollbar<br>
of a window which doesn't have the cursor focus, <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> is ignored.<br>
This allows quick adjustment of the relative offset of <a class="Type" href="options.html#'scrollbind'">'scrollbind'</a> windows.<br>
<br>
<span class="PreProc">==============================================================================</span><br>
6. Scrolling with a mouse wheel <a class="Constant" href="scroll.html#scroll-mouse-wheel" name="scroll-mouse-wheel">scroll-mouse-wheel</a><br>
<br>
When your mouse has a scroll wheel, it should work with Vim in the GUI. How<br>
it works depends on your system. It might also work in an xterm<br>
<a class="Identifier" href="scroll.html#xterm-mouse-wheel">xterm-mouse-wheel</a>. By default only vertical scroll wheels are supported,<br>
but some GUIs also support horizontal scroll wheels.<br>
<br>
For the Win32 GUI the scroll action is hard coded. It works just like<br>
dragging the scrollbar of the current window. How many lines are scrolled<br>
depends on your mouse driver. If the scroll action causes input focus<br>
problems, see <a class="Identifier" href="gui_w32.html#intellimouse-wheel-problems">intellimouse-wheel-problems</a>.<br>
<br>
For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key<br>
presses <span class="Special"><ScrollWheelUp></span>, <span class="Special"><ScrollWheelDown></span>, <span class="Special"><ScrollWheelLeft></span> and<br>
<span class="Special"><ScrollWheelRight></span>. For example, if you push the scroll wheel upwards a<br>
<span class="Special"><ScrollWheelUp></span> key press is generated causing the window to scroll upwards<br>
(while the text is actually moving downwards). The default action for these<br>
keys are:<br>
<span class="Special"><ScrollWheelUp></span> scroll three lines up <a class="Constant" href="scroll.html#<ScrollWheelUp>" name="<ScrollWheelUp>"><ScrollWheelUp></a><br>
<span class="Special"><S-ScrollWheelUp></span> scroll one page up <a class="Constant" href="scroll.html#<S-ScrollWheelUp>" name="<S-ScrollWheelUp>"><S-ScrollWheelUp></a><br>
<span class="Special"><C-ScrollWheelUp></span> scroll one page up <a class="Constant" href="scroll.html#<C-ScrollWheelUp>" name="<C-ScrollWheelUp>"><C-ScrollWheelUp></a><br>
<span class="Special"><ScrollWheelDown></span> scroll three lines down <a class="Constant" href="scroll.html#<ScrollWheelDown>" name="<ScrollWheelDown>"><ScrollWheelDown></a><br>
<span class="Special"><S-ScrollWheelDown></span> scroll one page down <a class="Constant" href="scroll.html#<S-ScrollWheelDown>" name="<S-ScrollWheelDown>"><S-ScrollWheelDown></a><br>
<span class="Special"><C-ScrollWheelDown></span> scroll one page down <a class="Constant" href="scroll.html#<C-ScrollWheelDown>" name="<C-ScrollWheelDown>"><C-ScrollWheelDown></a><br>
<span class="Special"><ScrollWheelLeft></span> scroll six columns left <a class="Constant" href="scroll.html#<ScrollWheelLeft>" name="<ScrollWheelLeft>"><ScrollWheelLeft></a><br>
<span class="Special"><S-ScrollWheelLeft></span> scroll one page left <a class="Constant" href="scroll.html#<S-ScrollWheelLeft>" name="<S-ScrollWheelLeft>"><S-ScrollWheelLeft></a><br>
<span class="Special"><C-ScrollWheelLeft></span> scroll one page left <a class="Constant" href="scroll.html#<C-ScrollWheelLeft>" name="<C-ScrollWheelLeft>"><C-ScrollWheelLeft></a><br>
<span class="Special"><ScrollWheelRight></span> scroll six columns right <a class="Constant" href="scroll.html#<ScrollWheelRight>" name="<ScrollWheelRight>"><ScrollWheelRight></a><br>
<span class="Special"><S-ScrollWheelRight></span> scroll one page right <a class="Constant" href="scroll.html#<S-ScrollWheelRight>" name="<S-ScrollWheelRight>"><S-ScrollWheelRight></a><br>
<span class="Special"><C-ScrollWheelRight></span> scroll one page right <a class="Constant" href="scroll.html#<C-ScrollWheelRight>" name="<C-ScrollWheelRight>"><C-ScrollWheelRight></a><br>
This should work in all modes, except when editing the command line.<br>
<br>
<span class="Todo">Note</span> that horizontal scrolling only works if <a class="Type" href="options.html#'nowrap'">'nowrap'</a> is set. Also, unless<br>
the "h" flag in <a class="Type" href="options.html#'guioptions'">'guioptions'</a> is set, the cursor moves to the longest visible<br>
line if the cursor line is about to be scrolled off the screen (similarly to<br>
how the horizontal scrollbar works).<br>
<br>
You can modify the default behavior by mapping the keys. For example, to make<br>
the scroll wheel move one line or half a page in Normal mode:<br>
<div class="helpExample"> :map <ScrollWheelUp> <C-Y><br>
:map <S-ScrollWheelUp> <C-U><br>
:map <ScrollWheelDown> <C-E><br>
:map <S-ScrollWheelDown> <C-D></div>
You can also use Alt and Ctrl modifiers.<br>
<br>
This only works when Vim gets the scroll wheel events, of course. You can<br>
check if this works with the "xev" program.<br>
<br>
When using XFree86, the /etc/XF86Config file should have the correct entry for<br>
your mouse. For FreeBSD, this entry works for a Logitech scrollmouse:<br>
<div class="helpExample"> Protocol "MouseMan"<br>
Device "/dev/psm0"<br>
ZAxisMapping 4 5</div>
See the XFree86 documentation for information.<br>
<br>
<a class="Constant" href="scroll.html#<MouseDown>" name="<MouseDown>"><MouseDown></a> <a class="Constant" href="scroll.html#<MouseUp>" name="<MouseUp>"><MouseUp></a><br>
The keys <span class="Special"><MouseDown></span> and <span class="Special"><MouseUp></span> have been deprecated. Use <span class="Special"><ScrollWheelUp></span><br>
instead of <span class="Special"><MouseDown></span> and use <span class="Special"><ScrollWheelDown></span> instead of <span class="Special"><MouseUp></span>.<br>
<br>
<a class="Constant" href="scroll.html#xterm-mouse-wheel" name="xterm-mouse-wheel">xterm-mouse-wheel</a><br>
To use the mouse wheel in a new xterm you only have to make the scroll wheel<br>
work in your Xserver, as mentioned above.<br>
<br>
To use the mouse wheel in an older xterm you must do this:<br>
1. Make it work in your Xserver, as mentioned above.<br>
2. Add translations for the xterm, so that the xterm will pass a scroll event<br>
to Vim as an escape sequence.<br>
3. Add mappings in Vim, to interpret the escape sequences as <span class="Special"><ScrollWheelDown></span><br>
or <span class="Special"><ScrollWheelUp></span> keys.<br>
<br>
You can do the translations by adding this to your ~.Xdefaults file (or other<br>
file where your X resources are kept):<br>
<br>
<div class="helpExample"> XTerm*VT100.Translations: #override \n\<br>
s<Btn4Down>: string("0x9b") string("[64~") \n\<br>
s<Btn5Down>: string("0x9b") string("[65~") \n\<br>
<Btn4Down>: string("0x9b") string("[62~") \n\<br>
<Btn5Down>: string("0x9b") string("[63~") \n\<br>
<Btn4Up>: \n\<br>
<Btn5Up>:</div>
<br>
Add these mappings to your vimrc file:<br>
<div class="helpExample"> :map <M-Esc>[62~ <ScrollWheelUp><br>
:map! <M-Esc>[62~ <ScrollWheelUp><br>
:map <M-Esc>[63~ <ScrollWheelDown><br>
:map! <M-Esc>[63~ <ScrollWheelDown><br>
:map <M-Esc>[64~ <S-ScrollWheelUp><br>
:map! <M-Esc>[64~ <S-ScrollWheelUp><br>
:map <M-Esc>[65~ <S-ScrollWheelDown><br>
:map! <M-Esc>[65~ <S-ScrollWheelDown></div>
<br>
vim:tw=78:ts=8:ft=help:norl:<br>
</div>
</article>
<footer>
<a href="#top">Return to the top</a> - <a href="index.html">Return to main</a>
<span class="EnglishJapaneseLink">
<span class="CurrentLanguage">English</span>
</span>
<br />
<div style="text-align:right;">
Hosted by <a href="https://github.com/vim-jp/vimdoc-en">vimdoc-en project</a><br />
If you met any problem, please report it to <a href="https://github.com/vim-jp/vimdoc-en/issues">issue</a>.<br />
</div>
</footer>
<!--<script src="js/check-referrer.js" type="text/javascript"></script>-->
</body>
</html>
<!-- vim:set ts=8 sts=2 sw=2 tw=0 et: -->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。