Vim practical guide (1): cursor movement (2)-movement within and between lines

Basic shortcut keys: hjkl will not be detailed.

1. Search within the line:

         1. Search backward in the line (find): f

               Such as: fl, search for l in the current line, if found, the cursor will locate the l character

         2. Find forward in the line (Find): F

                 Such as: Ff, search forward in the current line f, if found, the cursor will locate the f character

         3. Search backward in the line (to): t

              Such as: tn, search backward in the current line for n, if found, the cursor will be positioned to the character before the n character

         4. Search forward within the line (To): T

              Such as: Th, search forward in the current line for h, if found, the cursor will be positioned to the character after the h

   Note: 1. All the above commands can be prefixed with numbers, such as: 3tn (means performing the action of searching backward for three times)

             2. The above commands can be used with:,; use,

2. Jump from the beginning to the end of the line

        1. Jump to the beginning of the line: 0

        2. Jump to the beginning of the line (non-empty character): ^

        3. Jump to the end of the line: $

 Note: The above $ and commands can be prefixed with numbers, such as: 3$ (indicating jump to the end of the third line below the current line)

Three, move between lines

        1. Jump to the first line of the file: gg

        2. Jump to the last line of the file: G

        3. Jump to the nth line: ng such as: 30g means jump to the 30th line

                  

        4. Jump to the n% position of the current file: n% such as: 50% means jump to the 50% position of the current file

        5. Jump to the upper left position of the current screen (Home, High): H

        6. Jump to the middle of the current screen (Middle): M

        7. Jump to the lower left position of the current screen (Last, Low): L

                                     

Guess you like

Origin blog.csdn.net/lianshaohua/article/details/108540948