How to use VIM parameters

Source: Internet
Author: User

Vim General mode:

(1) Press the X key to delete the contents of the bank (backward delete)

(2) press SHIFT + X to delete the previous contents of the bank (delete forward)

(3) Press the number n and then press the X key to remove the N characters backwards

(4) Press the number n and then press SHIFT + X to remove n characters forward

(5) You can press the U key if you want to rewind the edit operation. Up to 50 times can be rolled back

(6) If you want to undo the fallback operation, you can press CTRL + R

(7) If you want to delete a row, press the D key two times, at which point the deleted content is stored in the clipboard of memory. If you press the P key at this point, you can paste the content you just deleted on the next line in the current row. If you press the SHIFT + P key, you can paste the previous line in the current row.

(8) If you press the number n and then the DD, you can delete the n rows.

(9) If you press the number n and then the YY, you can copy n rows.

(10) Press the number n, then press X, then delete (also cut) at this time. Of course, you can press p to paste at this point.

(11) Press the V key first, enter the visual mode, at this time press (H,J,K,L) key to move the cursor, select the selected text (or text block), and then press the X key, at this time the selected text (or text block) will be saved to the clipboard of memory

(A) Press the letter J cursor to move Down

(B) Press the letter K cursor to move upwards

(C) Press the letter H cursor to move left

(D) Press the letter L cursor to move right

(E) Press CTRL + B or the PageUp key cursor to move up the entire screen

(f) Press CTRL + F or the PageDown key cursor to move down the entire screen

(g) Press the SHIFT + G cursor to move to the end of the file.

(H) Press the letter G cursor to move to the first line of the file

(I) Press SHIFT + 4 ($) to move the cursor to the end of a line

(J) Press SHIFT + 6 (^) or the letter 0 cursor to move to the first letter of a line, but if there is a space before the first letter, then ctrl+6 (^), when the cursor moves to the first letter of non-whitespace, by the letter 0, the cursor moves to the first space.



Vim edit mode


(1) Press the I key, the cursor at the current position, and enter the editing mode

(2) Press the I key, at which point the cursor moves to the beginning of the current line and enters edit mode

(3) Press the A key, the cursor moves back one position and enters edit mode

(4) Press the A key, at which point the cursor moves to the end of the current line and enters edit mode

(5) Press the O key, at which point the cursor moves to the beginning of the next newly inserted line of the current line and enters edit mode

(6) Press the O key, at which point the cursor moves to the beginning of the newly inserted line on the current line and enters edit mode



VIM command line mode


: Wq Write and exit: W write: Q exit three can match! Using the force execution

On: Arrows on, K

Under: Arrows, J

Left: Arrow left, H

Right: Arrow right, L

2j: Walk down two lines, similar in other directions

Page DOWN: ctrl+f, PageDown

Page UP: ctrl+b, PageUp

GG: Jump to the first line

Shift+g: Jumps to the last line

Beginning of line: shift+6 (without spaces), home, 0

End of line: shift+4, end

Shift+g Positioning to line 10th

(K) number + SHIFT + G at which point the cursor jumps to the row where the number is


How to use VIM parameters

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.