The VIM editor uses

Source: Internet
Author: User

One, Text editor : Vi,vim



File Editor Categories:

Full Screen Text editor:




Text Editor:



Patterned editors: A variety of different modes

Edit mode: Command mode

Input mode: Insert mode

Last-line mode: Vim has many built-in commands, and this mode is the interface for its commands

1. Open File

Vim [OPTIONS] [FILE] ...

2. Conversion between modes :

The default is edit mode---> Input mode:

I:insert, at the current cursor, converted to input mode

I: Convert to input mode at the beginning of the line where the cursor is currently located

A:append, converted to input mode after the current cursor character

A: Convert to input mode at the end of the line at which the cursor is currently located

O: Create a new blank line below the current cursor line and convert to input mode

O: Create a new blank line above the line at the current cursor and convert to input mode

Input mode---> Edit mode: Press the ESC key

Edit Mode---> Last-line mode::

Last-line mode---> Edit mode: Press the ESC key

3. Exit Vim

Last-line mode:

Q! Force quit, do not save edited content to exit directly

Wq Save exit

X Save exit

wq!,x! Force Save exit

Edit mode:

ZZ: Save exit

4. Edit command

①, cursor movement:

Move between characters: H,j,k,l left, bottom, top, right #[h,j,k,l]: Move N-character spacing at a time

Move 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 #[w,e,b]

Jump at the end of the beginning line:

0: Jump to the absolute beginning

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

$: Jump to absolute end of line

Quick jump between lines: #G # # line last line mode: # jump to # # line

G text Tail

GG First

②, edit operation:

X: Delete the character of the cursor #x: Delete the cursor and the back of the male # characters

D: Delete command

DD: Delete cursor line is equivalent to D

#dd: Delete the line with the cursor and the next total # line

Use with the jump command:

d$: Delete the contents of the cursor at the end of the line



P: Paste,

Line level:

P: Paste below the line where the cursor is located

P: Paste above the line of the cursor

Less than line level:

P: Paste at the rear of the cursor

P: Paste in front of cursor

Y: Copy command

YY: Delete cursor line equals y

#yy: Delete the line with the cursor and the next total # line

Use with the jump command:

y$: Delete the contents of the cursor at the end of the line



C: Modify

Enter input mode after deletion

U: Undo #u undo the last # operation at one time

Ctrl+r Revocation of previous revocation

. Repeat the previous command

R: Replace command



Vimtutor Chinese Version

5, can be tested mode

V: Select the contents of the cursor to the left of the cursor line

V: The line where the cursor is located is selected

6. Flip Screen command in edit mode

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

7. Text lookup supports regular expressions



8. Text substitution

Last-line mode:

There are some built-in commands for editing operations, which can be done using the address-bound method

Address delimitation: Startline[,endline]

#: Line #

.: When moving forward

$: Last line

%: Full text

Relative delimitation:

+#: Down # lines from a specified position 10,+5

-#: # lines up from a specified position 10,-5

Text substitution: s

s/what to look for/replace with content/modifiers

/: Delimiter, used to split "what to find" and "Replace with" this delimiter can use other symbols such as: @,#.

You can use regular expressions to find what you want, and you can use the "&" reference in the "Replace with Content" section later

Replace with the content, not using regular expressions, generally normal text but you can use \1,\2 in regular expressions ... saved content


I: Case insensitive when looking for characters

G: Global Substitution

650) this.width=650; "src=" "title=" Smy%pz _x1q_zi3t8$luyn~n.png "alt=" Wkiol1xbofhqhginaafutikkswi798.jpg "/>

9. Multi-file Mode

Open File: Vim [OptIn] ... [FILE] ...

+#: Quick positioning to # line

+/pattern: Quickly navigate to the row that was first matched by the pattern

Multiple files:

Last-line mode:


Save and exit All files:


Multiple windows:

-o: Horizontal split window

-O: Vertical Split window


Note: Individual files can also be split into multiple windows for viewing

Ctrl+w,s Horizontal Split

Ctrl+w,v Vertical Segmentation

10. Interface Display Features

Last-line mode:

Show line number:

Set Number,set nu

Set Nonumber,set Nonu

Syntax highlighting:

Syntax on

Syntax off

Search highlighting

Set Hlsearch

Set Nohlsearch

Auto indent: Not turned on by default

Set Autoindent,set AI

Set Noauntoindent,set Noai

Distinguishing character case from opening and closing

Set Ignorecase,set IC

Set Noignorecase,set Noic

Highlight matching symbol pairs: default on

Set Showmatch,set SM

Set Noshowmatch,set NOSM

11. Vim Configuration file


Personal: ~/.VIMRC

The VIM editor uses

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: 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.