Vim in CentOS, centosvim

Source: Internet
Author: User

Vim in CentOS, centosvim

Install yum install-y vim-enhanced

Move cursor

H or the arrow key to the left: move the cursor to the left.

L or the right direction key: move the cursor one character to the right

J or downward direction key: move the cursor down a character

K or the upward direction key: move the cursor up a character

Ctrl + B: one page forward of the text page

Ctrl + F: The text page is displayed.

Number 0 or shift + 6: Move to the beginning of the row

Shift + 4: Move to the end of the row

Gg: Move to the first line

G: Move to the end of the row

NG (n is an arbitrary number): Move to row n

Delete, copy, and paste

X: delete backward

X: Forward Deletion

Nx: deletes n characters from the backend.

Dd: delete/cut the row where the cursor is located

Ndd: delete or cut n rows after the row where the cursor is located

Yy: copy the row where the cursor is located

P: paste the copied or pasted content from the row where the cursor is located.

P: paste the copied or pasted content from the row where the cursor is located.

Nyy: Copy n rows down from the row where the cursor is located

U: Restore the previous operation

V: After you press v, move the cursor to select the specified character, and then copy, paste, and so on.

Enter edit mode

I: insert it before the current character

I: insert at the beginning of the row where the cursor is located

A: insert it after the current character

A: insert behavior in the row where the cursor is located

O: Insert a new row into the next row of the current row.

O: Insert a new row into the previous row of the current row.

Other functions

: W save text

: Q: Exit Vim.

: W! Force save. In the root user, instant text can be saved only.

: Q! Force exit. All changes do not take effect

: Wq save and exit

: Set nu display row number

: Set nonu does not display row numbers

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.