Vim editor commands, common commands for extended mode

Source: Internet
Author: User

Vim the mode and transformation relationship 1 is shown. A simple introduction to command patterns and common commands for extended mode.

650) this.width=650; "src=" Https://s1.51cto.com/wyfs02/M02/9D/C4/wKioL1mFjIHAnfyFAAC6xpPfTZI075.png "title=" a.png "Width=" "height=" 242 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:400px;height:242px; "alt=" Wkiol1mfjihanfyfaac6xppftzi075.png "/>

Figure 1

Command mode

Jump between characters:

h : Left L: Right J: under K: on

#COMMAND : Jump by # The specified number of characters

Jump between words:

W : The first word of the next word

e : The ending of the current or next word

b : The first word of the current or previous word

#COMMAND : by # Specify the number of words to jump at a time

Current page Jump:

H: Top M: Page Middle row L: bottom of page

Beginning line End Jump:

^: jumps to the first non-whitespace character at the beginning of a line

0: jump to beginning of line

$: jump to end of line

Move between rows:

#G , extended mode: # : Jump to the # Specify Rows

G : Last line

1G, GG: First line

Move between sentences:

): Next sentence (: Previous

Move between paragraphs:

}: Next paragraph {: Previous paragraph

Ctrl+f: Flip a screen to the end of the file

Ctrl+b: Flip a screen to the file header

Ctrl+d: Turn half screen at the end of the file

Ctrl+u: Turn half screen to file header

go to insert mode:

I:insert, Enter at the cursor location

I : Enter at the beginning of the line where the current cursor is located

A:append, ENTER after cursor location

A : Enter at the end of the line at which the current cursor is located

o: opens a new row below the current cursor line

O: Opens a new line above the line where the current cursor is located

Character deletion

x: Delete the character at the cursor

#x: deletes the start of the cursor at the # of characters  

XP: swap the position of the character where the cursor is located and the character after it

~: Convert Case

J: Remove line breaks after the current line

Replace command (R, replace)

r: replace the character at which the cursor is located

R: switch to REPLACE mode

Delete command                       

d$: Delete to end of line

d^: Delete to non-empty header

D0: Delete to the beginning of the line

DD: Delete the line where the cursor is located

#dd: Multi-line deletion

D : Deletes from the current cursor position to the end of the line, leaving blank lines equal to d$

Copy command

y : copy, behave similarly to D Command

y$ : Copy to end of line

y0 : Copy to beginning of line ( including whitespace characters )

y^ : Copy to beginning of line ( not including whitespace characters )

ye : Copy to the ending of the current or next word

yw : Copy to the beginning of the next word

#yy : Copy Multiple lines

Paste command

P : If the buffer is an entire row, paste the current cursor below the row;

, then paste to the back of the current cursor where

P: If the buffer is an entire row, the current cursor is pasted above the row;

is pasted to the front of the current cursor where

undo Changes

U undo Recent Changes

#u undo many changes before

U undo Cursor falls on this line after all the changes of this row

Press Ctrl-r Redo the final undo Change

. : repeats the previous action

N.: repeats the previous action n Times

Extended Mode

Address delimitation

# specific Section # rows, such as 2 represents the first 2 Line

#,# from the left # represents the starting line to the right # represents the end line

#,+# from the left # represents the starting line, plus the right side # number of rows represented

: 2,+3 represents 2 to the 5 Line

. Current Line

$ last line

., $-1 current line to penultimate line

% Full text , equivalent to 1,$

Find

/pattern : Looks at the end of the file from the current cursor location

? PATTERN: Finds the file header from the current cursor location

N : Same direction as command

N: Opposite direction of command

S: to complete the find and replace operation in extended mode

format:s/what to look for/ Replace with content / modifiers

What to look for: Available modes

Replace with: cannot use mode, but can use \1, \2, ... You can also use the "&" reference to find the entire contents of the previous lookup

Modifier:

I: Ignore case

G: global substitution; By default, each row replaces only the first occurrence of the

GC: global substitution, asking before each replacement


Commands for the Vim editor, common commands for extended mode

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.