Use of the vim editor in linux and the vim editor in linux

Source: Internet
Author: User

Use of the vim editor in linux and the vim editor in linux

Vi or vim editor is an indispensable editor. There are many editors available on windows, such as notepad, notepad ++, and edit,

But in linux, it is basically vi or vim. vim is bigger than vi, and it is an enhanced version of vi. Therefore, it is necessary to learn about vim.

Use the vi text editor to edit the generated file
* ***** Basic usage
Vi? Somefile.4
1. First, the system enters "Normal Mode". This mode only accepts various shortcut keys and cannot edit the file content.
2. Press the I key to enter the editing mode from the normal mode. In this mode, all files are typed in.
3. After editing, Press Esc to exit the editing mode and return to normal mode;
4. Press: To enter the "baseline command mode", enter the wq command, and press Enter.


* ***** Some common shortcut keys
Some useful shortcut keys (used in normal mode ):
A? Insert at the end of the cursor
A? ? Insert at the end of the row
I? ? Insert at the beginning of the row
Gg? ? Directly jump to the first line of the file
G? ? Directly jump to the last line of the file
Dd? ? Delete a row. If? 5dd? ?, Delete the 5 rows after the cursor at a time.
Yy? Copy the current row ,? Copy multiple rows, then? 3yy, copy the three rows near the current row
P? ? Paste
V? Enter the character selection mode. After the selection is complete, copy by y and paste by p.
Ctrl + v? Enter the block selection mode. After the selection is complete, copy by y and paste by p.
Shift + v? Enter the row selection mode. After the selection is complete, copy by y and paste by p.

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.