1.1-1.5-vim Editor

Source: Internet
Author: User

Vim is an upgraded version of VI

There are 3 modes of operation:1 General mode 2 edit Mode 3 Command mode

A after the cursor insert I before the cursor insert o insert a new line under the cursor

A at the end of the cursor insert I at the beginning of the cursor insert o insert a new line on the cursor

$ cursor moves to the end of line 0 cursor moves to the beginning of the

GG cursor to first line g cursor to last line

X Delete the character at the cursor where DD deletes the clipping cursor in the row

yy/y copy Current line p cursor is pasted under line

R replaces a character R replaces the character that follows the cursor, ESC exits

U undo the previous action, up to 50 undo. Ctrl+r anti-undo, just correspond to u

and? You can find the keywords and use N and N to find the next.

When a keyword is searched, it is highlighted. Use: Nohl to cancel highlighting

: Set Nu Set line number: Set Nonu cancel line number

: Set IC operation ignored case: Set Noic off Ignore case

: 1,20s/old/new/g replaces 1-20 rows of old with the new G parameter for global substitution

One row has multiple old, replace all, or replace only one old

:%s/old/new/c full text replace C parameter for prompt user confirmation

:%s/\/etc\/passwd/1/escaped with \ for directory reasons

:%s #/etc/passwd#1 or split with #* etc.

: Wq=:x=zz Save Exit

: W/home/wyp file Save and save a copy in/home/wyp

: R/etc/wyp the contents of the/ETC/WYP into the current cursor

:! LS/ETC execute commands from Linux in Vim without having to exit vim

: R!date Inserts the system time under the current cursor


1.1-1.5-vim Editor

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.