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