annotate runtime/doc/scroll.txt @ 15286:d2a162896a2a v8.1.0651

patch 8.1.0651: :args "foo works like :args without argument commit https://github.com/vim/vim/commit/2ac372ccee1af6f9fa105bf2648d5e4efa554236 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Dec 28 19:06:47 2018 +0100 patch 8.1.0651: :args \"foo works like :args without argument Problem: :args \"foo works like :args without argument. Solution: Fix check for empty argument. (closes https://github.com/vim/vim/issues/3728)
author Bram Moolenaar <Bram@vim.org>
date Fri, 28 Dec 2018 19:15:05 +0100
parents 2f7e67dd088c
children 0e473e9e70c2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13963
1174611ad715 Vim 8.1 release
Christian Brabandt <cb@256bit.org>
parents: 13818
diff changeset
1 *scroll.txt* For Vim version 8.1. Last change: 2018 Apr 26
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 VIM REFERENCE MANUAL by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 Scrolling *scrolling*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 These commands move the contents of the window. If the cursor position is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 moved off of the window, the cursor is moved onto the window (with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 'scrolloff' screen lines around it). A page is the number of lines in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 window minus two. The mnemonics for these commands may be a bit confusing.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 Remember that the commands refer to moving the window (the part of the buffer
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 that you see) upwards or downwards in the buffer. When the window moves
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 upwards in the buffer, the text in the window moves downwards on your screen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 See section |03.7| of the user manual for an introduction.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 1. Scrolling downwards |scroll-down|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 2. Scrolling upwards |scroll-up|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 3. Scrolling relative to cursor |scroll-cursor|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 4. Scrolling horizontally |scroll-horizontal|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 5. Scrolling synchronously |scroll-binding|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 6. Scrolling with a mouse wheel |scroll-mouse-wheel|
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 1. Scrolling downwards *scroll-down*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 The following commands move the edit window (the part of the buffer that you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 see) downwards (this means that more lines downwards in the text buffer can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 seen):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 *CTRL-E*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 CTRL-E Scroll window [count] lines downwards in the buffer.
13818
28ac7914b2b6 Update runtime files and translations
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
35 The text moves upwards on the screen.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 Mnemonic: Extra lines.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 *CTRL-D*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 CTRL-D Scroll window Downwards in the buffer. The number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 lines comes from the 'scroll' option (default: half a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 screen). If [count] given, first set 'scroll' option
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 to [count]. The cursor is moved the same number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 lines down in the file (if possible; when lines wrap
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 and when hitting the end of the file there may be a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 difference). When the cursor is on the last line of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 the buffer nothing happens and a beep is produced.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 See also 'startofline' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 {difference from vi: Vim scrolls 'scroll' screen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 lines, instead of file lines; makes a difference when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 lines wrap}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 <S-Down> or *<S-Down>* *<kPageDown>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 <PageDown> or *<PageDown>* *CTRL-F*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 CTRL-F Scroll window [count] pages Forwards (downwards) in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 the buffer. See also 'startofline' option.
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 7
diff changeset
56 When there is only one window the 'window' option
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 7
diff changeset
57 might be used.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 *z+*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 z+ Without [count]: Redraw with the line just below the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 window at the top of the window. Put the cursor in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 that line, at the first non-blank in the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 With [count]: just like "z<CR>".
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 2. Scrolling upwards *scroll-up*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 The following commands move the edit window (the part of the buffer that you
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 see) upwards (this means that more lines upwards in the text buffer can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70 seen):
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 *CTRL-Y*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 CTRL-Y Scroll window [count] lines upwards in the buffer.
13818
28ac7914b2b6 Update runtime files and translations
Christian Brabandt <cb@256bit.org>
parents: 11062
diff changeset
74 The text moves downwards on the screen.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 Note: When using the MS-Windows key bindings CTRL-Y is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 remapped to redo.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 *CTRL-U*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 CTRL-U Scroll window Upwards in the buffer. The number of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 lines comes from the 'scroll' option (default: half a
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 screen). If [count] given, first set the 'scroll'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 option to [count]. The cursor is moved the same
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 number of lines up in the file (if possible; when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 lines wrap and when hitting the end of the file there
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 may be a difference). When the cursor is on the first
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 line of the buffer nothing happens and a beep is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 produced. See also 'startofline' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 {difference from vi: Vim scrolls 'scroll' screen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 lines, instead of file lines; makes a difference when
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 lines wrap}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 <S-Up> or *<S-Up>* *<kPageUp>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 <PageUp> or *<PageUp>* *CTRL-B*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 CTRL-B Scroll window [count] pages Backwards (upwards) in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 buffer. See also 'startofline' option.
164
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 7
diff changeset
96 When there is only one window the 'window' option
8b0ee9d57d7f updated for version 7.0050
vimboss
parents: 7
diff changeset
97 might be used.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 *z^*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 z^ Without [count]: Redraw with the line just above the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 window at the bottom of the window. Put the cursor in
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 that line, at the first non-blank in the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 With [count]: First scroll the text to put the [count]
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 line at the bottom of the window, then redraw with the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 line which is now at the top of the window at the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 bottom of the window. Put the cursor in that line, at
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 the first non-blank in the line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 3. Scrolling relative to cursor *scroll-cursor*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 The following commands reposition the edit window (the part of the buffer that
10385
368468ef35cf commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
113 you see) while keeping the cursor on the same line. Note that the 'scrolloff'
368468ef35cf commit https://github.com/vim/vim/commit/c0514bf4777a1d55f5785b3887c5686fd0bbe870
Christian Brabandt <cb@256bit.org>
parents: 10198
diff changeset
114 option may cause context lines to show above and below the cursor.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 *z<CR>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 z<CR> Redraw, line [count] at top of window (default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 cursor line). Put cursor at first non-blank in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 *zt*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122 zt Like "z<CR>", but leave the cursor in the same
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 column. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 *zN<CR>*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126 z{height}<CR> Redraw, make window {height} lines tall. This is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 useful to make the number of lines small when screen
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 updating is very slow. Cannot make the height more
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 than the physical screen height.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 *z.*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 z. Redraw, line [count] at center of window (default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
133 cursor line). Put cursor at first non-blank in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
134 line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
136 *zz*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
137 zz Like "z.", but leave the cursor in the same column.
2207
b17bbfa96fa0 Add the settabvar() and gettabvar() functions.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
138 Careful: If caps-lock is on, this command becomes
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
139 "ZZ": write buffer and exit! {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
140
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
141 *z-*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 z- Redraw, line [count] at bottom of window (default
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
143 cursor line). Put cursor at first non-blank in the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
146 *zb*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 zb Like "z-", but leave the cursor in the same column.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
148 {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
150 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 4. Scrolling horizontally *scroll-horizontal*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 For the following four commands the cursor follows the screen. If the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154 character that the cursor is on is moved off the screen, the cursor is moved
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 to the closest character that is on the screen. The value of 'sidescroll' is
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
156 not used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
157
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
158 z<Right> or *zl* *z<Right>*
604
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
159 zl Move the view on the text [count] characters to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
160 right, thus scroll the text [count] characters to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
161 left. This only works when 'wrap' is off. {not in
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
162 Vi}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164 z<Left> or *zh* *z<Left>*
604
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
165 zh Move the view on the text [count] characters to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
166 left, thus scroll the text [count] characters to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
167 right. This only works when 'wrap' is off. {not in
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
168 Vi}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 *zL*
604
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
171 zL Move the view on the text half a screenwidth to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
172 right, thus scroll the text half a screenwidth to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
173 left. This only works when 'wrap' is off. {not in
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
174 Vi}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 *zH*
604
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
177 zH Move the view on the text half a screenwidth to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
178 left, thus scroll the text half a screenwidth to the
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
179 right. This only works when 'wrap' is off. {not in
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
180 Vi}
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 For the following two commands the cursor is not moved in the text, only the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 text scrolls on the screen.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 *zs*
604
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
186 zs Scroll the text horizontally to position the cursor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 at the start (left side) of the screen. This only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 works when 'wrap' is off. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 *ze*
604
2930fd8e7d9f updated for version 7.0171
vimboss
parents: 237
diff changeset
191 ze Scroll the text horizontally to position the cursor
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 at the end (right side) of the screen. This only
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 works when 'wrap' is off. {not in Vi}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 5. Scrolling synchronously *scroll-binding*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 Occasionally, it is desirable to bind two or more windows together such that
2207
b17bbfa96fa0 Add the settabvar() and gettabvar() functions.
Bram Moolenaar <bram@vim.org>
parents: 2154
diff changeset
199 when one window is scrolled, the other windows are also scrolled. In Vim,
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 windows can be given this behavior by setting the (window-specific)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 'scrollbind' option. When a window that has 'scrollbind' set is scrolled, all
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 other 'scrollbind' windows are scrolled the same amount, if possible. The
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 behavior of 'scrollbind' can be modified by the 'scrollopt' option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 When using the scrollbars, the binding only happens when scrolling the window
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 with focus (where the cursor is). You can use this to avoid scroll-binding
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207 for a moment without resetting options.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
209 When a window also has the 'diff' option set, the scroll-binding uses the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 differences between the two buffers to synchronize the position precisely.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 Otherwise the following method is used.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
212
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 *scrollbind-relative*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 Each 'scrollbind' window keeps track of its "relative offset," which can be
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 thought of as the difference between the current window's vertical scroll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 position and the other window's vertical scroll position. When one of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 'scrollbind' windows is asked to vertically scroll past the beginning or end
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 limit of its text, the window no longer scrolls, but remembers how far past
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 the limit it wishes to be. The window keeps this information so that it can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 maintain the same relative offset, regardless of its being asked to scroll
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 past its buffer's limits.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 However, if a 'scrollbind' window that has a relative offset that is past its
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 buffer's limits is given the cursor focus, the other 'scrollbind' windows must
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 jump to a location where the current window's relative offset is valid. This
11062
1218c5353e2b Runtime file updates.
Christian Brabandt <cb@256bit.org>
parents: 10385
diff changeset
226 behavior can be changed by clearing the "jump" flag from the 'scrollopt'
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 option.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228
1125
96cd8222a819 updated for version 7.1a
vimboss
parents: 874
diff changeset
229 *syncbind* *:syncbind* *:sync*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230 :syncbind Force all 'scrollbind' windows to have the same
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 relative offset. I.e., when any of the 'scrollbind'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
232 windows is scrolled to the top of its buffer, all of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 the 'scrollbind' windows will also be at the top of
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 their buffers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
235
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 *scrollbind-quickadj*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 The 'scrollbind' flag is meaningful when using keyboard commands to vertically
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 scroll a window, and also meaningful when using the vertical scrollbar of the
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 window which has the cursor focus. However, when using the vertical scrollbar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 This allows quick adjustment of the relative offset of 'scrollbind' windows.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 ==============================================================================
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 6. Scrolling with a mouse wheel *scroll-mouse-wheel*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 When your mouse has a scroll wheel, it should work with Vim in the GUI. How
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 it works depends on your system. It might also work in an xterm
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
248 |xterm-mouse-wheel|. By default only vertical scroll wheels are supported,
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
249 but some GUIs also support horizontal scroll wheels.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 For the Win32 GUI the scroll action is hard coded. It works just like
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 dragging the scrollbar of the current window. How many lines are scrolled
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 depends on your mouse driver. If the scroll action causes input focus
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254 problems, see |intellimouse-wheel-problems|.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
256 For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
257 presses <ScrollWheelUp>, <ScrollWheelDown>, <ScrollWheelLeft> and
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
258 <ScrollWheelRight>. For example, if you push the scroll wheel upwards a
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
259 <ScrollWheelUp> key press is generated causing the window to scroll upwards
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
260 (while the text is actually moving downwards). The default action for these
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
261 keys are:
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
262 <ScrollWheelUp> scroll three lines up *<ScrollWheelUp>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
263 <S-ScrollWheelUp> scroll one page up *<S-ScrollWheelUp>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
264 <C-ScrollWheelUp> scroll one page up *<C-ScrollWheelUp>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
265 <ScrollWheelDown> scroll three lines down *<ScrollWheelDown>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
266 <S-ScrollWheelDown> scroll one page down *<S-ScrollWheelDown>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
267 <C-ScrollWheelDown> scroll one page down *<C-ScrollWheelDown>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
268 <ScrollWheelLeft> scroll six columns left *<ScrollWheelLeft>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
269 <S-ScrollWheelLeft> scroll one page left *<S-ScrollWheelLeft>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
270 <C-ScrollWheelLeft> scroll one page left *<C-ScrollWheelLeft>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
271 <ScrollWheelRight> scroll six columns right *<ScrollWheelRight>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
272 <S-ScrollWheelRight> scroll one page right *<S-ScrollWheelRight>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
273 <C-ScrollWheelRight> scroll one page right *<C-ScrollWheelRight>*
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 This should work in all modes, except when editing the command line.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
276 Note that horizontal scrolling only works if 'nowrap' is set. Also, unless
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
277 the "h" flag in 'guioptions' is set, the cursor moves to the longest visible
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
278 line if the cursor line is about to be scrolled off the screen (similarly to
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
279 how the horizontal scrollbar works).
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
281 You can modify the default behavior by mapping the keys. For example, to make
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
282 the scroll wheel move one line or half a page in Normal mode: >
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
283 :map <ScrollWheelUp> <C-Y>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
284 :map <S-ScrollWheelUp> <C-U>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
285 :map <ScrollWheelDown> <C-E>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
286 :map <S-ScrollWheelDown> <C-D>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 You can also use Alt and Ctrl modifiers.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
289 This only works when Vim gets the scroll wheel events, of course. You can
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 check if this works with the "xev" program.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291
237
73354c21f1e4 updated for version 7.0066
vimboss
parents: 164
diff changeset
292 When using XFree86, the /etc/XF86Config file should have the correct entry for
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 Protocol "MouseMan"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 Device "/dev/psm0"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 ZAxisMapping 4 5
237
73354c21f1e4 updated for version 7.0066
vimboss
parents: 164
diff changeset
297 See the XFree86 documentation for information.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
299 *<MouseDown>* *<MouseUp>*
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
300 The keys <MouseDown> and <MouseUp> have been deprecated. Use <ScrollWheelUp>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
301 instead of <MouseDown> and use <ScrollWheelDown> instead of <MouseUp>.
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
302
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 *xterm-mouse-wheel*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304 To use the mouse wheel in a new xterm you only have to make the scroll wheel
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 work in your Xserver, as mentioned above.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 To use the mouse wheel in an older xterm you must do this:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 1. Make it work in your Xserver, as mentioned above.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 2. Add translations for the xterm, so that the xterm will pass a scroll event
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 to Vim as an escape sequence.
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
311 3. Add mappings in Vim, to interpret the escape sequences as <ScrollWheelDown>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
312 or <ScrollWheelUp> keys.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314 You can do the translations by adding this to your ~.Xdefaults file (or other
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 file where your X resources are kept): >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
316
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 XTerm*VT100.Translations: #override \n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 s<Btn4Down>: string("0x9b") string("[64~") \n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 s<Btn5Down>: string("0x9b") string("[65~") \n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 <Btn4Down>: string("0x9b") string("[62~") \n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 <Btn5Down>: string("0x9b") string("[63~") \n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322 <Btn4Up>: \n\
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 <Btn5Up>:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
324
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 Add these mappings to your vimrc file: >
2409
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
326 :map <M-Esc>[62~ <ScrollWheelUp>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
327 :map! <M-Esc>[62~ <ScrollWheelUp>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
328 :map <M-Esc>[63~ <ScrollWheelDown>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
329 :map! <M-Esc>[63~ <ScrollWheelDown>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
330 :map <M-Esc>[64~ <S-ScrollWheelUp>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
331 :map! <M-Esc>[64~ <S-ScrollWheelUp>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
332 :map <M-Esc>[65~ <S-ScrollWheelDown>
0ca06a92adfb Add support for horizontal scroll wheel. (Bjorn Winckler)
Bram Moolenaar <bram@vim.org>
parents: 2345
diff changeset
333 :map! <M-Esc>[65~ <S-ScrollWheelDown>
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 <
14421
2f7e67dd088c Update runtime files.
Christian Brabandt <cb@256bit.org>
parents: 13963
diff changeset
335 vim:tw=78:ts=8:noet:ft=help:norl: