Vim edit artifact Common basic commands

Source: Internet
Author: User

Three modes of vim editing artifact:

    • Command mode
    • Insert mode
    • Last-line mode
  $vim name +number Jump directly to the number line of the fileCommand mode, insert mode i : Insert before current cursor I : .... at the beginning of A : Insert after current cursor A : ..... At the end of your line o : Insert next line O: Previous line Insert Command -mode commands dd : Delete the current row n dd : Delete n rows continuously from the current line D : Delete everything from behind the cursor x : Delete the character of the cursor X : The character before the cursor is deleted yy : Copy the current line n yy : Copy the current line to start a continuous n row P : Start pasting from the next line where the cursor is located R : Replace the character where the cursor is located R : Replace the character before the cursor >> : Indent the current line to the right n >> : Indents the current line to the right by N-Grid << : Indent the current line to the left n << : Indents the current line to the left N grid G : To the last line of the file GG : To the first line of the file ctrl+r : Cancel Undo u : Undo last-line mode : Set number : 1,4 > : 1,4 < : Wq Save and exit : x Save and exit : q! does not save exit Replace | In the last line mode:  :%s/replaced content/replace content/g replaceExample:: 50,100s/man/man/g to replace man in 50-100 rows with man

Vim edit artifact Common basic commands

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.