Vim shortcut keys

Source: Internet
Author: User
Tags save file

G jump to end of file

GG jumps to the first line of the file

Number 0 jumps to the beginning of the current line

$ jumps to the end of the current line

Ngg N is a number that moves to the nth row of a file, such as a 11gg row that can be moved to line 11th,

YY copy when moving forward

Nyy N is a number, the copy cursor starts down n rows

p/p p Pastes the copied data to the next line of the cursor, and p is pasted to the previous line

DD Delete the line where the cursor is located

NDD n is numeric, delete cursor starts down n line

U Redo Previous Action

Ctrl+r Restore the previous operation, used in conjunction with u

DGG delete the current line to the first row

DG deletes the current line to the last row

I insert text at the current cursor position

A prompt insert text at the next word in the current cursor

o Insert a new row at the next line in the row where the current cursor is located

Ees exit edit mode, return to normal mode

/oldboy starts at the cursor position and looks down for a string named Oldboy

Oldboy start at the cursor position and look up for a string named Oldboy

N starts from the cursor position and repeats the previous search action down

N starts from the cursor position and repeats the previous search action up

:%s/a/b/g Replace all contents of A with B

: W Save File

: Q exit

: Wq Exit Save

: wq! Launch and force save,! for mandatory meaning

: q! Force quit, do not save

: Set NU Displays line number

This article from the "12216950" blog, reproduced please contact the author!

Vim shortcut keys

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.