Linux Learning-Vim editor

Source: Internet
Author: User

There are three modes of VIM

Command mode, default into command mode;

Edit mode, a I o enter the editing mode, you can edit the text content; Esc tangent back to command mode

Expansion mode,: Enter the expansion mode, you can save the exit and other operations, ESC cut back to the command mode

Key operations commonly used under VIM

DD Two d means to delete the contents of the line where the cursor is located

U undo the last step operation

CTRL + R Next, and U just the opposite, U is the last step ctrl+r is next

NDD deletes multiple rows, n is a number, and deletes the contents of n rows containing the current row.

YY the copy cursor is in the row

Nyy the following n-line contents of the row where the cursor is copied, including the cursor

P lowercase p Paste paste to the next line in the current row

P Capital P Paste to the previous row of the current line

YYNP Paste the contents of the previous copy n rows, which is two merged commands, yy is copy, then perform NP

DDP cut means that it is also a merge command that deletes the contents of the current line and pastes it somewhere

$ quick Move cursor to line end, Command mode

0 Number 0 quickly move the cursor to the beginning of the line, in command mode

GG jumps to the very first position of the entire file

G jumps to the top of the last line of the entire file

NG jumps to the first line of the file n is a number

H jumps to the top of the screen, at the top of the screen, not at the top of the file

M jumps to the middle of the screen, which is the middle of the screen

L jump to the bottom of the screen, the bottom of the screen

Set NU Display line number

Add: Jump to the beginning of the command is CTRL + A, jump to the end of the command line is ctrl+e, this is not vim, is the command under the operating interface

  

  

Linux Learning-Vim editor

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.