Common Vim shortcut keys

Source: Internet
Author: User

In VI, moving the cursor and editing are two things. Because they are distinguished, you can easily perform optical calibration.
It is useful to move the cursor a little faster. The C-representation in the text is Ctrl, case sensitive. Cursor Positioning
You also need to combine the search.

=== Cursor position ==

H or ^ h move one character to the left

J or ^ n move down a row

K or ^ P move up a row

L or move one character to the right by Space

W moves to the beginning of the next word

W moves to the beginning of the next word, ignoring punctuation. By default, w considers the string to be separated by spaces.

CP/mnt/Marvell/Main. sh/STV/

Therefore, the preceding row has only three strings, namely, 1 CP 2/mnt/Marvell/Main. SH 3/STV/

This is different from W.


E move to the end of the next word

E. Move to the end of the next word and ignore punctuation marks.

B is moved to the beginning of the previous word

B is moved to the beginning of the previous word, ignoring the punctuation mark with W

| Move to the first column of the current row


0 is moved to the first column of the current row, and the blank space before the row is ignored.


N | column N to the current row

^ Move the first non-null character to the current row

$ Move to the last character of the current row

Return or + move to the first character of the next line

-Move to the first non-null character in the previous line

L move to the last line of the screen

M moves to the middle line of the screen

H move to the first line of the screen

G move to the last row of the file

Ng moves to the nth line of the file



(Move to the beginning of a sentence

) Move to the end of the sentence

{Move to the beginning of a paragraph // when I use it, I find that {only move to the first blank line} is moved to the first blank line.

} Move to the beginning of the next paragraph

/** Insert the first column of VIM {to define a paragraph */

[Return to the beginning of a paragraph

] Move Forward to the beginning of the next paragraph

M (a-z) uses a letter to mark the current position. For example, use MZ to Mark Z.

'(A-z) move the cursor to the specified tag. For example, use 'z to move the cursor to Z.
  
''This command is quite useful. It moves the cursor to the previous tag, for example, using Gd, *, and so on (here, two single quotes are not double quotes)
After finding a word, enter this command to return to the position where it was last stayed.

'. This Command makes it very easy to move the cursor to the last modified line.

'. This command is quite powerful. It moves the cursor to the last modification point.

% Move from the beginning of braces to the end of braces

: Adding the row number to the back is to jump to this line.

<C-O> the cursor returns to a previous position. It is equivalent to a "undo" move by the cursor"

<C-I> the cursor returns to a later position. It is equivalent to "Restoring" when the cursor moves"

F move the cursor to character a of the current row, and NF move the cursor to CHARACTER n of the current row

F opposite


=== Screen positioning ==

C-E: Roll a row on the screen

C-y rolls a row down the screen

C-u rolls the screen half a page

C-d: roll down half of the screen

C-B rolls one page of the screen

C-F rolls the screen down one page

Z-return: set the current row to the top line of the screen.

NZ-return: set row N under the current row to the top line of the screen.

Z. Set the current row to the center of the screen

NZ. Set row N on the current row to the center of the screen

Z-set the current row to the bottom line of the screen

NZ-set row N on the current row to the bottom line of the screen

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.