Mercurial > vim
comparison runtime/doc/motion.txt @ 24278:4ab4ef0c48b1
Update runtime files.
Commit: https://github.com/vim/vim/commit/dad4473f02e1fec86d43a2fc094536a4b27d3b25
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 31 20:07:33 2021 +0200
Update runtime files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 31 Mar 2021 20:15:04 +0200 |
parents | 5b7ea82bc18f |
children | fd37be6dc258 |
comparison
equal
deleted
inserted
replaced
24277:1ada4a68ac43 | 24278:4ab4ef0c48b1 |
---|---|
1 *motion.txt* For Vim version 8.2. Last change: 2020 Oct 18 | 1 *motion.txt* For Vim version 8.2. Last change: 2021 Mar 28 |
2 | 2 |
3 | 3 |
4 VIM REFERENCE MANUAL by Bram Moolenaar | 4 VIM REFERENCE MANUAL by Bram Moolenaar |
5 | 5 |
6 | 6 |
940 ]' [count] times to next line with a lowercase mark below | 940 ]' [count] times to next line with a lowercase mark below |
941 the cursor, on the first non-blank character in the | 941 the cursor, on the first non-blank character in the |
942 line. | 942 line. |
943 | 943 |
944 *]`* | 944 *]`* |
945 ]` [count] times to lowercase mark after the cursor. {not | 945 ]` [count] times to lowercase mark after the cursor. |
946 in Vi} | |
947 | 946 |
948 *['* | 947 *['* |
949 [' [count] times to previous line with a lowercase mark | 948 [' [count] times to previous line with a lowercase mark |
950 before the cursor, on the first non-blank character in | 949 before the cursor, on the first non-blank character in |
951 the line. | 950 the line. |
1035 <Tab> or *CTRL-I* *<Tab>* | 1034 <Tab> or *CTRL-I* *<Tab>* |
1036 CTRL-I Go to [count] newer cursor position in jump list | 1035 CTRL-I Go to [count] newer cursor position in jump list |
1037 (not a motion command). | 1036 (not a motion command). |
1038 {not available without the |+jumplist| feature} | 1037 {not available without the |+jumplist| feature} |
1039 | 1038 |
1039 NOTE: In the GUI and in a terminal supporting | |
1040 |modifyOtherKeys|, CTRL-I can be mapped separately | |
1041 from <Tab>, on the condition that CTRL-I is | |
1042 mapped before <Tab>, otherwise the mapping applies to | |
1043 both. | |
1044 | |
1040 *:ju* *:jumps* | 1045 *:ju* *:jumps* |
1041 :ju[mps] Print the jump list (not a motion command). | 1046 :ju[mps] Print the jump list (not a motion command). |
1042 {not available without the |+jumplist| feature} | 1047 {not available without the |+jumplist| feature} |
1043 | 1048 |
1044 *:cle* *:clearjumps* | 1049 *:cle* *:clearjumps* |
1052 The maximum number of entries is fixed at 100. | 1057 The maximum number of entries is fixed at 100. |
1053 {not available without the |+jumplist| feature} | 1058 {not available without the |+jumplist| feature} |
1054 | 1059 |
1055 For example, after three jump commands you have this jump list: | 1060 For example, after three jump commands you have this jump list: |
1056 | 1061 |
1057 jump line col file/text ~ | 1062 jump line col file/text ~ |
1058 3 1 0 some text ~ | 1063 3 1 0 some text ~ |
1059 2 70 0 another line ~ | 1064 2 70 0 another line ~ |
1060 1 1154 23 end. ~ | 1065 1 1154 23 end. ~ |
1061 > ~ | 1066 > ~ |
1062 | 1067 |
1063 The "file/text" column shows the file name, or the text at the jump if it is | 1068 The "file/text" column shows the file name, or the text at the jump if it is |
1064 in the current file (an indent is removed and a long line is truncated to fit | 1069 in the current file (an indent is removed and a long line is truncated to fit |
1065 in the window). | 1070 in the window). |
1066 | 1071 |
1067 You are currently in line 1167. If you then use the CTRL-O command, the | 1072 You are currently in line 1167. If you then use the CTRL-O command, the |
1068 cursor is put in line 1154. This results in: | 1073 cursor is put in line 1154. This results in: |
1069 | 1074 |
1070 jump line col file/text ~ | 1075 jump line col file/text ~ |
1071 2 1 0 some text ~ | 1076 2 1 0 some text ~ |
1072 1 70 0 another line ~ | 1077 1 70 0 another line ~ |
1073 > 0 1154 23 end. ~ | 1078 > 0 1154 23 end. ~ |
1074 1 1167 0 foo bar ~ | 1079 1 1167 0 foo bar ~ |
1075 | 1080 |
1076 The pointer will be set at the last used jump position. The next CTRL-O | 1081 The pointer will be set at the last used jump position. The next CTRL-O |
1077 command will use the entry above it, the next CTRL-I command will use the | 1082 command will use the entry above it, the next CTRL-I command will use the |
1078 entry below it. If the pointer is below the last entry, this indicates that | 1083 entry below it. If the pointer is below the last entry, this indicates that |
1079 you did not use a CTRL-I or CTRL-O before. In this case the CTRL-O command | 1084 you did not use a CTRL-I or CTRL-O before. In this case the CTRL-O command |
1096 that calling setpos() does not do this. | 1101 that calling setpos() does not do this. |
1097 | 1102 |
1098 After the CTRL-O command that got you into line 1154 you could give another | 1103 After the CTRL-O command that got you into line 1154 you could give another |
1099 jump command (e.g., "G"). The jump list would then become: | 1104 jump command (e.g., "G"). The jump list would then become: |
1100 | 1105 |
1101 jump line col file/text ~ | 1106 jump line col file/text ~ |
1102 4 1 0 some text ~ | 1107 4 1 0 some text ~ |
1103 3 70 0 another line ~ | 1108 3 70 0 another line ~ |
1104 2 1167 0 foo bar ~ | 1109 2 1167 0 foo bar ~ |
1105 1 1154 23 end. ~ | 1110 1 1154 23 end. ~ |
1106 > ~ | 1111 > ~ |
1107 | 1112 |
1108 The line numbers will be adjusted for deleted and inserted lines. This fails | 1113 The line numbers will be adjusted for deleted and inserted lines. This fails |
1109 if you stop editing a file without writing, like with ":n!". | 1114 if you stop editing a file without writing, like with ":n!". |
1110 | 1115 |
1111 When you split a window, the jumplist will be copied to the new window. | 1116 When you split a window, the jumplist will be copied to the new window. |
1150 | 1155 |
1151 Note that when text has been inserted or deleted the cursor position might be | 1156 Note that when text has been inserted or deleted the cursor position might be |
1152 a bit different from the position of the change. Especially when lines have | 1157 a bit different from the position of the change. Especially when lines have |
1153 been deleted. | 1158 been deleted. |
1154 | 1159 |
1155 When the |:keepjumps| command modifier is used the position of a change is not | 1160 When the `:keepjumps` command modifier is used the position of a change is not |
1156 remembered. | 1161 remembered. |
1157 | 1162 |
1158 *:changes* | 1163 *:changes* |
1159 :changes Print the change list. A ">" character indicates the | 1164 :changes Print the change list. A ">" character indicates the |
1160 current position. Just after a change it is below the | 1165 current position. Just after a change it is below the |
1191 'matchpairs' option) | 1196 'matchpairs' option) |
1192 /* */ start or end of C-style comment | 1197 /* */ start or end of C-style comment |
1193 #if, #ifdef, #else, #elif, #endif | 1198 #if, #ifdef, #else, #elif, #endif |
1194 C preprocessor conditionals (when the | 1199 C preprocessor conditionals (when the |
1195 cursor is on the # or no ([{ | 1200 cursor is on the # or no ([{ |
1196 following) | 1201 is following) |
1197 For other items the matchit plugin can be used, see | 1202 For other items the matchit plugin can be used, see |
1198 |matchit-install|. This plugin also helps to skip | 1203 |matchit-install|. This plugin also helps to skip |
1199 matches in comments. | 1204 matches in comments. |
1200 | 1205 |
1201 When 'cpoptions' contains "M" |cpo-M| backslashes | 1206 When 'cpoptions' contains "M" |cpo-M| backslashes |
1220 No count is allowed, {count}% jumps to a line {count} | 1225 No count is allowed, {count}% jumps to a line {count} |
1221 percentage down the file |N%|. Using '%' on | 1226 percentage down the file |N%|. Using '%' on |
1222 #if/#else/#endif makes the movement linewise. | 1227 #if/#else/#endif makes the movement linewise. |
1223 | 1228 |
1224 *[(* | 1229 *[(* |
1225 [( go to [count] previous unmatched '('. | 1230 [( Go to [count] previous unmatched '('. |
1226 |exclusive| motion. | 1231 |exclusive| motion. |
1227 | |
1228 *[{* | 1232 *[{* |
1229 [{ go to [count] previous unmatched '{'. | 1233 [{ Go to [count] previous unmatched '{'. |
1230 |exclusive| motion. | 1234 |exclusive| motion. |
1231 | |
1232 *])* | 1235 *])* |
1233 ]) go to [count] next unmatched ')'. | 1236 ]) Go to [count] next unmatched ')'. |
1234 |exclusive| motion. | 1237 |exclusive| motion. |
1235 | |
1236 *]}* | 1238 *]}* |
1237 ]} go to [count] next unmatched '}'. | 1239 ]} Go to [count] next unmatched '}'. |
1238 |exclusive| motion. | 1240 |exclusive| motion. |
1239 | 1241 |
1240 The above four commands can be used to go to the start or end of the current | 1242 The above four commands can be used to go to the start or end of the current |
1241 code block. It is like doing "%" on the '(', ')', '{' or '}' at the other | 1243 code block. It is like doing "%" on the '(', ')', '{' or '}' at the other |
1242 end of the code block, but you can do this from anywhere in the code block. | 1244 end of the code block, but you can do this from anywhere in the code block. |
1266 similar structured language). When not after the | 1268 similar structured language). When not after the |
1267 end of a method, jump to the start or end of the | 1269 end of a method, jump to the start or end of the |
1268 class. When no '}' is found before the cursor this is | 1270 class. When no '}' is found before the cursor this is |
1269 an error. |exclusive| motion. | 1271 an error. |exclusive| motion. |
1270 | 1272 |
1271 The above two commands assume that the file contains a class with methods. | 1273 The above four commands assume that the file contains a class with methods. |
1272 The class definition is surrounded in '{' and '}'. Each method in the class | 1274 The class definition is surrounded in '{' and '}'. Each method in the class |
1273 is also surrounded with '{' and '}'. This applies to the Java language. The | 1275 is also surrounded with '{' and '}'. This applies to the Java language. The |
1274 file looks like this: > | 1276 file looks like this: > |
1275 | 1277 |
1276 // comment | 1278 // comment |
1280 } | 1282 } |
1281 int method_two() { | 1283 int method_two() { |
1282 body_two(); | 1284 body_two(); |
1283 } | 1285 } |
1284 } | 1286 } |
1287 | |
1288 [To try this out copy the text and put it in a new buffer, the help text above | |
1289 confuses the jump commands] | |
1290 | |
1285 Starting with the cursor on "body_two()", using "[m" will jump to the '{' at | 1291 Starting with the cursor on "body_two()", using "[m" will jump to the '{' at |
1286 the start of "method_two()" (obviously this is much more useful when the | 1292 the start of "method_two()" (obviously this is much more useful when the |
1287 method is long!). Using "2[m" will jump to the start of "method_one()". | 1293 method is long!). Using "2[m" will jump to the start of "method_one()". |
1288 Using "3[m" will jump to the start of the class. | 1294 Using "3[m" will jump to the start of the class. |
1289 | 1295 |
1290 *[#* | 1296 *[#* |
1291 [# go to [count] previous unmatched "#if" or "#else". | 1297 [# Go to [count] previous unmatched "#if" or "#else". |
1292 |exclusive| motion. | 1298 |exclusive| motion. |
1293 | 1299 |
1294 *]#* | 1300 *]#* |
1295 ]# go to [count] next unmatched "#else" or "#endif". | 1301 ]# Go to [count] next unmatched "#else" or "#endif". |
1296 |exclusive| motion. | 1302 |exclusive| motion. |
1297 | 1303 |
1298 These two commands work in C programs that contain #if/#else/#endif | 1304 These two commands work in C programs that contain #if/#else/#endif |
1299 constructs. It brings you to the start or end of the #if/#else/#endif where | 1305 constructs. It brings you to the start or end of the #if/#else/#endif where |
1300 the current line is included. You can then use "%" to go to the matching line. | 1306 the current line is included. You can then use "%" to go to the matching line. |
1301 | 1307 |
1302 *[star* *[/* | 1308 *[star* *[/* |
1303 [* or [/ go to [count] previous start of a C comment "/*". | 1309 [* or [/ Go to [count] previous start of a C comment "/*". |
1304 |exclusive| motion. | 1310 |exclusive| motion. |
1305 | 1311 |
1306 *]star* *]/* | 1312 *]star* *]/* |
1307 ]* or ]/ go to [count] next end of a C comment "*/". | 1313 ]* or ]/ Go to [count] next end of a C comment "*/". |
1308 |exclusive| motion. | 1314 |exclusive| motion. |
1309 | 1315 |
1310 | 1316 |
1311 *H* | 1317 *H* |
1312 H To line [count] from top (Home) of window (default: | 1318 H To line [count] from top (Home) of window (default: |