Some common commands for vim (i)

Source: Internet
Author: User

First confirm that in normal mode, if you do not confirm, press ESC several times.
: Sy on/clear
SY indicates syntax highlighting, on is open, clear is canceled.
: Set go=
Set represents the general setting, go is the abbreviation of GUI option, is the interface, is equal to empty, is nothing.
: Colo ev (+TAB, auto-complete for evening)
Colo set the color scheme. Comes in 10 kinds.
: Tabnew d:\t (+tab, will automatically complete the file with T starting with the D drive)
The file opens as a multi-tabbed page and uses: Set Go=e to style the label at the top.
* * Replace operation * *
:%s/the following is/\R&/GC
s represents a substitution, and s/a/b represents a substitution of a b;\r for a carriage return,& represents the part that is replaced.
% represents the full text, and the GC represents a replacement (not just one), and the user acknowledges it.
: W means save.
GG indicates that the cursor moves the beginning of the article.
2x means delete two characters.
U means undo.
Ctrl+r jumps to the latest changed position.
DD means delete row, 3d means delete 3 lines, DG means delete all.
* * Column Operation * *
GG .... gg$ means to move to the last character of the first line.
The ctrl+q is converted to blocks, and 15j indicates that 15 rows are selected and X is deleted.

operation of the document(Open, Close, save):
: E file closes the currently edited files and opens a new file.
: e# back to the file you just edited
: f filename Changes the edited file name, which is equivalent to save as when saving.
: n1,n2w filename selectively saves content from a N1 line to a N2 row.
: Browse e opens a file browser.
: Sex Horizontal Split window
: Vex Vertical Split window
operation of the cursor
Basic move (in normal mode)
H left J down K up L move right
+ (to use ctrl) or ENTER: Move the cursor to the first non-whitespace character on the next line.
-(Do not use ctrl): Moves the cursor to the first non-whitespace character on the previous line.
W,e is the next (after) move a word, W jumps to the beginning of the word, e jumps to the end of the word.
GE on (front) moves a word to the end.
b Top (front) moves a word to the beginning.
(: Move forward one sentence;): Move back one sentence.
{: Move forward a paragraph;}: move back a paragraph.
FC: Moves the cursor to the next C character in the same line. Uppercase indicates upward.
3FC: Move the cursor to the third C character of the same line. Uppercase indicates upward.
TC: Moves the cursor to the next C character in the same line. Uppercase indicates upward.
----can be used with n----
0 moves to the beginning of the line, ^ moves to the first non-whitespace character of the bank.
$ move to the end of the line.
H move the cursor to the top row of the screen.
M
L
GG jumps to the head of the file; G jumps to the end of the file.
Flip Screen
Ctrl+f down one screen
Ctrl+b on one screen
Ctrl+d Down half screen
Ctrl+u down half the line
Ctrl+y scroll up one line
n% the location of the n% to the file.
ZT moves the current line to the top of the screen
ZZ moves the current line to the center of the screen
ZB move the current line to the bottom of the screen
Tag (the size brackets do not have to be entered when they are actually edited)
Use markers to move quickly. After you reach the marker, you can use Ctrl+o to return to the original position. Ctrl+o and Ctrl+i are much like forward and backward on the browser.
M{A-Z} marks the location of the cursor, the local tag, only for the current file.
M{A-Z} marks the location where the cursor is located, all marked. Reboot, the tag is still valid.
' {A-Z} moves to the location of the tag.
' {A-Z} moves to the beginning of the marker.
"Move to the last edited place. "Yes, but ' more finely cut. If you want to jump to an older location, you can press C-o and jump to the new location with C-i.
' Move to the last place you left.
`. Move to the last changed place.
: Marks displays all the tags.
:d Elmarks Delete Tags A and b.
:d elmarks a-c Remove Tags A, b, and C.
:d Elmarks A c-f delete the tag a,c,d,e,f.
:d elmarks! Deletes all the tokens for the current buffer.
: Help mark-motions see more about Mark's knowledge.

Some common commands for vim (i)

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.