The use of the VI editor for Linux

Source: Internet
Author: User

Today, let's take a look at the use of the VI editor, the VI editor is primarily used to edit configuration files in a Linux environment.

First, how to use:

1. Enter command vi filename, open file, in a viewing mode

2. Click on Keyboard i to enter insert mode;

3. Modify or enter the content;

4. Press ESC to exit edit mode;

5. Press "Shift" plus "colon", enter Wq, save exit; Q, exit directly; q!, Force exit.

Second, vi editor search

1./string: Search up from the current cursor position

? String: Search down from the current cursor position

2. Find Next: Press "N".

Third, vi Editor add line number (in Ubuntu, for example, other environments may not be the same)

1. Enter the catalogue/etc/vim;

2. Edit the configuration file VIMRC (vi VIMRC);

3. Add a line of content "set Nu" to save the exit.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!! ~~~~~~~~~~~~~~~~~~

Jump to the specified line number and enter directly: N (n = line number to jump)


Iv. vi Editor Replacement text function ~~~~~~~~~~~~~ later

The use of the VI editor for Linux

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: 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.