Linux:vim Simple Start

Source: Internet
Author: User

Now the Linux system is generally installed by default vim editor, if there is no VIM editor installed, there will be a VI editor, the VI editor produced more time than the mouse to come earlier, although the function is very powerful, but I recommend the installation of Vim tool, after the installation of Vim, VI is automatically soft-connected to the Vim editor. The next step is to introduce some simple tips for getting started, and then using the Vim editor is the equivalent of using Notepad as simple, but more powerful vim.

Vim Sub-command mode and insert mode, when vi a new file, the default into the command mode, at this time press I can enter the insertion mode. Here are some simple commands:

  Command mode:

  Move:

H = left L = right K = up J =

G = moves to the last line, does not enter insert mode

GG = return to the beginning

Number n + k/j = Move Up/down n rows

Enter: number, enter set NU on the command line, you can display all the line number, after: Enter the corresponding number n can be moved to the corresponding line

After: Enter "/xx" in the file to find XX

  Insert:

I/= insert before cursor

I = insert at current beginning

A = insert after the cursor

A = insert at the end of the current line

  Copy:

YY = copy Current line + P = paste

Number n + YY + = copy n rows from the current line

  Delete:

x = Delete Cursor position content

DD = Delete the current line (DD This command is actually with the cut meaning, press P can paste the deleted information)

Number n + DD = delete N rows starting from the current line

Number n + x = Remove n from cursor

  

  Insert mode

  Move:

      Direction key

  Delete:

      BACKSPACE: Backspace

  

Linux:vim Simple Start

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.