Vim Text Editor

Source: Internet
Author: User

Vi/vim is the most commonly used text editor on Unix/linux and is very powerful. Only commands, no menus.

1. Insert command

I insert before the cursor

I start inserting at the current line of the cursor

A after the cursor is inserted

A inserts at the end of the current line of the cursor

o Insert a new row on the next line of the current line of the cursor

O Insert a new row on the previous line of the cursor's current row

2. Positioning commands

: Set NU Displays line number

: Set Nonu Cancel line number

GG to the first line of text

G to the last line of text

: N to the nth line of text (: 180)

3. Delete command

X Delete the character at cursor location

N (x) × delete n characters after cursor location

DD deletes the row where the cursor is located.

NDD Delete N rows

DG deletes the line to the end of the cursor, so the content

D Delete the contents of the cursor at the end of the line

: n1,n2d deletes the specified range of rows: 100,150d

4. Replace and Cancel commands

U Undo, cancel the previous action

Ctrl + R Redo, before returning to undo

R replaces the character at which the cursor is located

R starts at the point where the cursor is located, and ends by pressing the ESC key

5. Common shortcut keys

Shift+ ZZ Save exit with same function as ": Wq"

V Enter character Visual mode

V or Shift + V Enter line visual mode

Ctrl + V Enter block Visual mode

Vim Text 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.