VIM editor Usage Details, vim editor details

Source: Internet
Author: User

VIM editor Usage Details, vim editor details

The Vim text editor is installed on all Linux operating systems by default. It is a very useful editor.

Three Modes

It has three modes: Command mode and last line mode.

Command mode: controls the movement of the cursor to copy, paste, delete, and search the text.

Input mode: normal text input.

Last line mode: Save or exit the document, and set the editing environment.

Command

Command

Function

: W

Save

: Q

Exit

: Q!

Force exit (discard the modified content of the document)

: Wq!

Force save and exit

: Set nu

Show row number

: Set nonu

Do not show row number

: Command

Run this command

: Integer

Jump to this row

Use Vim + space + file name. after entering the Vim editor, you need to enter the input mode before writing the file. After writing the file, press the ESC key to return to the command mode from the input mode, and then enter: you can switch wq to the Moxing mode to save and exit the operation.

Configure Nic Information

After a simple Vim operation, we can configure the NIC information.

Switch to the/etc/sysconfig/network-scripts directory and store the NIC configuration file;

Then use the Vim editor to modify the NIC file. If you do not know the NIC file name, run the ifconfig command to confirm the NIC name.

Finally, enable the NIC information change. After the configuration is released, the change takes effect only after the NIC is restarted.

Write scripts

The Vim editor is even more powerful in writing scripts. You can execute commands without executing them yourself. We can write some operations that can be completed only by linux, instead of manual input, you can perform the operation on a regular basis. Of course, we can also write scripts that can interact with users. You just can't think of them, but you can't do it without them. Let's talk about how to write the script later.

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.