Summary of COMMON commands for LINUX vim compilers

Source: Internet
Author: User
Tags switches

9.Vim editor

the enhanced version of the Vi editor supports multiple language scripts, file type plugins, text completion modes, and many other options.

Command mode: For file navigation, cut and paste both simple commands. Undo recovery and other operations, also in this mode

Insert mode: For general text compilation, substitution mode is a variant of the insert pattern.

Ex mode : used to save, exit, and open files, as well as search, replace, and other complex operations.

I command mode switch to insert mode, start inserting before cursor

A command mode switches to insert mode and starts inserting after the cursor

I Command mode switches to insert mode, at the beginning of the current line

A Command mode switches to insert mode at the end of the current line

o Command mode switches to insert mode, opening a new line below the current line

O Command mode switches to insert mode, opening a new line above the current line

R starts with the character under the cursor, switches to replace mode, does not insert text, and each character you enter replaces the current document character.

Command-line mode:

K Move up one line

H Move left one row l move right one line

J Move down one line

#h Move # characters

^ move to the current start position

$ Move to the current end position

GG moves to the first line of the document

G move to the last line of the document

#G jump to line #

W moves to the beginning of the next word

b jumps to the beginning of the current or previous word

E jumps to the ending of the current or next word

#w Moving # words

o Absolute Beginning

(Place the cursor at the beginning of the current or previous sentence

) to move the cursor to the beginning of the next word

{The beginning of the current or previous paragraph of the cursor

Move the cursor to the beginning of the next paragraph

Ctrl+f turn down one screen

Ctrl+b Turn One screen upwards

Ctrl+d turn down half screen

Ctrl+u turn up half screen

D Delete text

#dd Delete # lines

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

d$ Delete the row of the cursor to the last character of the line

D0 Delete the cursor to the first character in the row

DlG Delete all the contents of the first line of the cursor

DG Deletes the contents of the cursor to the last line

X Delete the character at the cursor

Y Delete text

yy copy entire row

#yy Copy # lines

YLG Copy all the contents of the cursor column to the first row

YG Copy all the contents of the row to the last column of the cursor

y0 Copy all the contents of the line to the beginning of the cursor

y$ Copy all the contents of the line to the end of the cursor

P Lowercase Paste when the cursor is behind

P- Caps Paste when the cursor is behind

U Recovery

Ctrl+r Repeat the previous action

. repeat a previous action

/AA Search for this word under the cursor

? AA looking for a AA string above the cursor

N repeat the previous search content

N do the opposite of the previous search, such as the previous command? Aa, the word is searched under the cursor.

:100,200s/www.qixoo.qixoo.com/aa/bb/g the AA to bb between lines

:1,$s/aa/bb/gc replace AA with BB in the first line to the end , but replace it with the user before replacing it.

Replacement mode (one of the insert modes):

Replace text

Vim allows users to replace large amounts of text with the change command. To use: Press the C key followed by the cursor movement, for example, the CW current cursor position changes to the end of the current word. The text to be replaced is deleted (placed in an unnamed register), andvim switches to insert mode.

CC replaces in a range of rows

The CIW replaces the entire current word

CAW replaces the entire current word with any empty space around it.

C $ replaces the end of the line.

ESC insert mode switch to command mode

Ex mode:

:Wq Save exit

:w save does not exit

:w<aa> saves the current file with a file name of AA

:q exits the current file

:q! Force exit of the current file

LINUX vim Compiler common commands summary

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.