Basic commands commonly used in VIM

Source: Internet
Author: User

General mode available commands, including cursor movement, copy and paste, find and replace functions

ctrl+f: Screen moves down one page, quite page DOWN button

ctrl+b: Screen moves up one page, quite page Up button

0 or home key : Move to the beginning of the line

$ or End: Move to end of line

NG: Moves to the nth row of the current file, omitting n moves to the last row

GG or 1G: Move to the first line of the current file

/word: Looking down for a string with the name "word"

n: Repeats the previous find operation, such as after executing/word, pressing N to continue looking down to the next word string

: N1,N2S/WORD1/WORD2/GC: Indicates that the string is found between N1 to N2 rows, and replaced by Word2,c to indicate whether user confirmation is required before substitution, and not before the substitution if C is omitted.

: 1, $s/word1/word2/g: Represents the string to find word1 from the first line to the last row, and is replaced with Word2

x,x: X for backward deletion of a character equivalent to the DEL key, X for the forward deletion of a character equivalent to the backspace button

ndd: Deletes the N-line down the cursor, omitting n means deleting the current line of the cursor

nyy: Copy the N-line down the cursor, omitting n indicates the current row of the replication cursor

p,p: p To paste the copied data on the next line of the cursor, p instead, paste the copied data on the previous line of the cursor

u: revert undo previous action

ctrl+r: Redo Last Action

. : A decimal point, which means repeating the previous command

command line set line number

: Set nu: Display line number

: Set Nonu: Cancel line number

Basic commands commonly used in VIM

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.