summaryrefslogtreecommitdiffstats
path: root/runtime/doc/motion.txt
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-03-31 20:07:33 +0200
committerBram Moolenaar <Bram@vim.org>2021-03-31 20:07:33 +0200
commitdad4473f02e1fec86d43a2fc094536a4b27d3b25 (patch)
tree4a4bf9401af5629b17baa31380edf4563618685e /runtime/doc/motion.txt
parentae0f151ddf76dcbb233cff02282deb4f98a355ec (diff)
Update runtime files.
Diffstat (limited to 'runtime/doc/motion.txt')
-rw-r--r--runtime/doc/motion.txt72
1 files changed, 39 insertions, 33 deletions
diff --git a/runtime/doc/motion.txt b/runtime/doc/motion.txt
index d6215a4c61..4dc0e2e28c 100644
--- a/runtime/doc/motion.txt
+++ b/runtime/doc/motion.txt
@@ -1,4 +1,4 @@
-*motion.txt* For Vim version 8.2. Last change: 2020 Oct 18
+*motion.txt* For Vim version 8.2. Last change: 2021 Mar 28
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -942,8 +942,7 @@ These commands are not marks themselves, but jump to a mark:
line.
*]`*
-]` [count] times to lowercase mark after the cursor. {not
- in Vi}
+]` [count] times to lowercase mark after the cursor.
*['*
[' [count] times to previous line with a lowercase mark
@@ -1037,6 +1036,12 @@ CTRL-I Go to [count] newer cursor position in jump list
(not a motion command).
{not available without the |+jumplist| feature}
+ NOTE: In the GUI and in a terminal supporting
+ |modifyOtherKeys|, CTRL-I can be mapped separately
+ from <Tab>, on the condition that CTRL-I is
+ mapped before <Tab>, otherwise the mapping applies to
+ both.
+
*:ju* *:jumps*
:ju[mps] Print the jump list (not a motion command).
{not available without the |+jumplist| feature}
@@ -1054,11 +1059,11 @@ The maximum number of entries is fixed at 100.
For example, after three jump commands you have this jump list:
- jump line col file/text ~
- 3 1 0 some text ~
- 2 70 0 another line ~
- 1 1154 23 end. ~
- > ~
+ jump line col file/text ~
+ 3 1 0 some text ~
+ 2 70 0 another line ~
+ 1 1154 23 end. ~
+ > ~
The "file/text" column shows the file name, or the text at the jump if it is
in the current file (an indent is removed and a long line is truncated to fit
@@ -1067,11 +1072,11 @@ in the window).
You are currently in line 1167. If you then use the CTRL-O command, the
cursor is put in line 1154. This results in:
- jump line col file/text ~
- 2 1 0 some text ~
- 1 70 0 another line ~
- > 0 1154 23 end. ~
- 1 1167 0 foo bar ~
+ jump line col file/text ~
+ 2 1 0 some text ~
+ 1 70 0 another line ~
+ > 0 1154 23 end. ~
+ 1 1167 0 foo bar ~
The pointer will be set at the last used jump position. The next CTRL-O
command will use the entry above it, the next CTRL-I command will use the
@@ -1098,12 +1103,12 @@ that calling setpos() does not do this.
After the CTRL-O command that got you into line 1154 you could give another
jump command (e.g., "G"). The jump list would then become:
- jump line col file/text ~
- 4 1 0 some text ~
- 3 70 0 another line ~
- 2 1167 0 foo bar ~
- 1 1154 23 end. ~
- > ~
+ jump line col file/text ~
+ 4 1 0 some text ~
+ 3 70 0 another line ~
+ 2 1167 0 foo bar ~
+ 1 1154 23 end. ~
+ > ~
The line numbers will be adjusted for deleted and inserted lines. This fails
if you stop editing a file without writing, like with ":n!".
@@ -1152,7 +1157,7 @@ Note that when text has been inserted or deleted the cursor position might be
a bit different from the position of the change. Especially when lines have
been deleted.
-When the |:keepjumps| command modifier is used the position of a change is not
+When the `:keepjumps` command modifier is used the position of a change is not
remembered.
*:changes*
@@ -1193,7 +1198,7 @@ remembered.
#if, #ifdef, #else, #elif, #endif
C preprocessor conditionals (when the
cursor is on the # or no ([{
- following)
+ is following)
For other items the matchit plugin can be used, see
|matchit-install|. This plugin also helps to skip
matches in comments.
@@ -1222,19 +1227,16 @@ remembered.
#if/#else/#endif makes the movement linewise.
*[(*
-[( go to [count] previous unmatched '('.
+[( Go to [count] previous unmatched '('.
|exclusive| motion.
-
*[{*
-[{ go to [count] previous unmatched '{'.
+[{ Go to [count] previous unmatched '{'.
|exclusive| motion.
-
*])*
-]) go to [count] next unmatched ')'.
+]) Go to [count] next unmatched ')'.
|exclusive| motion.
-
*]}*
-]} go to [count] next unmatched '}'.
+]} Go to [count] next unmatched '}'.
|exclusive| motion.
The above four commands can be used to go to the start or end of the current
@@ -1268,7 +1270,7 @@ bring you back to the switch statement.
class. When no '}' is found before the cursor this is
an error. |exclusive| motion.
-The above two commands assume that the file contains a class with methods.
+The above four commands assume that the file contains a class with methods.
The class definition is surrounded in '{' and '}'. Each method in the class
is also surrounded with '{' and '}'. This applies to the Java language. The
file looks like this: >
@@ -1282,17 +1284,21 @@ file looks like this: >
body_two();
}
}
+
+[To try this out copy the text and put it in a new buffer, the help text above
+confuses the jump commands]
+
Starting with the cursor on "body_two()", using "[m" will jump to the '{' at
the start of "method_two()" (obviously this is much more useful when the
method is long!). Using "2[m" will jump to the start of "method_one()".
Using "3[m" will jump to the start of the class.
*[#*
-[# go to [count] previous unmatched "#if" or "#else".
+[# Go to [count] previous unmatched "#if" or "#else".
|exclusive| motion.
*]#*
-]# go to [count] next unmatched "#else" or "#endif".
+]# Go to [count] next unmatched "#else" or "#endif".
|exclusive| motion.
These two commands work in C programs that contain #if/#else/#endif
@@ -1300,11 +1306,11 @@ constructs. It brings you to the start or end of the #if/#else/#endif where
the current line is included. You can then use "%" to go to the matching line.
*[star* *[/*
-[* or [/ go to [count] previous start of a C comment "/*".
+[* or [/ Go to [count] previous start of a C comment "/*".
|exclusive| motion.
*]star* *]/*
-]* or ]/ go to [count] next end of a C comment "*/".
+]* or ]/ Go to [count] next end of a C comment "*/".
|exclusive| motion.