vim editor necessary

vim editor of the most powerful features is that internal commands and rules, the following methods commonly used vim editor and rules

Command line mode: Delete, copy, posting, revoked, may be switched to the input mode, the input mode jump to press the Esc key command mode, the command commonly defined as below:

yy: copy cursor line

nyy: Copy n lines

3yy: Copy 3 lines

p, P: Paste

yw: copy phrases cursor, does not copy punctuation

3yw: Copy the three phrases

u: undo the last

U: undo all current

dd: delete the entire line

ndd: Delete n lines

x: delete a character

u: progressive withdrawal

dw: Delete a phrase

a: from the start position a cursor character input

A: Since the end of the line where the cursor begins entry

i: from a position before the start of the character entry cursor

I: From the beginning of the line where the cursor start entry

o: next line the cursor jumps to the start line entry

O: Skip the cursor line on the start line of the line entry

R: Alternatively starts from the cursor position

Line mode Key features include Find, Replace, the last line save and exit:

: W: save

: Q: quit

: S / x / y: line replacement

: Wq: Save and exit

1,5sx.y: Alternatively 1,5-line

: Wq! : Force Quit

1, $ sx / y: Forced save and exit

: X: save

/ Word: front to back to find, search elements are

? word: looking forward from the back,

: S / old / new / g: Replace the old new, the premise is that the cursor must be a line

: S / old / new this line to the last line of old replaced by new offers only the first

: 1, $ s / old / new / g of the first row to the last row of the new replacement old

1,2,3a / old / new / g: first row, second row first twenty-three new row to the third row of the new

vim + 2 jfedu.txt: Open jfedu.txt file, and positions the cursor on the second line

vim + / string jfedu.txt: Open jfedu.txt file and search for the keyword

 

Guess you like

Origin www.cnblogs.com/key-l731/p/11241814.html