Some common simple operation summary of Vim _linux

Source: Internet
Author: User

Objective

Vim is Linux under quite a piece of text processing artifact Also, is VI Editor upgrade version, the full name of the VI improved. and VI is the abbreviation of visual interface, they are processing ASCII character data, skilled use of vim is absolutely your ability to become a Linux Daniel, the so-called Trinidad, a one way.

Below on my learning process some very commonly used in the more practical usage to do a summary

Vim Undo and redo operations

In non-editable mode, use U to undo the last action and use Ctrl+r to recover the last action.

Vim block selection and copy paste

Vim enters a file, Presses V, enters VISUAL mode, uses h,j,k,l or arrow keys to move the cursor to select the content, press Y to complete the copy, press p to complete the paste where you need to paste.

Press V to enter visual mode, press V again to exit visual mode. If you copy the content, you can also press I into edit mode for editing, and then ESC quits to use p to finish pasting.

Vim moves to the beginning and end

Beginning and end of document

GG: Command moves the cursor to the beginning of the document

G: Command moves the cursor to the end of the document

The beginning and end of a line

0 move to the beginning of a line

$ move to end of line

Vim page

Corresponds to the effect of page up and PAGE down.

Ctrl+f the whole screen forward

Ctrl+b a whole screen back

Ctrl+d the half screen forward

Ctrl+u Roll back half screen

Vim deletes one or more rows

DD Deletes a row

NDD deletes the n rows starting with the current line

Vim Copy Multiple lines

: 9,15 copy 16 or: 9,15 Co 16

This may include:

: 9,15 move 16 or: 9,15 m 16 moves the text from line 9th to line 15th to the back of line 16th

Summarize

Just write so much, these are the functions that can be used frequently. Vim's function is very powerful, first of all these commonly used simple foundation of the society, their own combination of the explanation slowly groping, basic these almost enough ordinary work. I hope this article can be for everyone's study or work to bring certain help.

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.