Dialog UNIX: the improved Vim Editor

Source: Internet
Author: User
Tags line editor
Article Title: Dialog UNIX: the improved Vim editor. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

If you used to work with IBM? AIX? (UNIX? Or Linux? The vi editor is probably used. Since the concept of vi was proposed in 1976, it has become the main tool for editing files. You may ask, "Is there an editing tool that is more powerful than vi ?" Of course, this is Vim. This article will introduce in detail the Vim enhancements, which make Vim a widely used editor in UNIX and Linux fields.

The vi Program is a powerful text editor. William Joy, co-founder of Sun Microsystems, initially wrote a vi editor for earlier versions of Berkeley Software Distribution (BSD) UNIX in 1976. It is said that Bill wrote vi over a weekend, but he said it was a rumor. This program is named after the visual command in the UNIX extension line editor-"ex" for short.

The vi editor is a powerful editor with several features that are not noticed by many people. Vi is a model editor, so different settings will produce different results. There are three different modes in vi: Command, insert (or input), and line. In insert mode, the text is written to the temporary editing file. In normal mode, the same key-click triggers commands embedded in the editor. To enter the insert mode, press the I key. to exit the command mode, press Escape (I will introduce the line mode in more detail later in this article ).

For example, in insert mode, if the input string is 10dd, the string is written to a temporary file, as shown in 1.

Figure 1. Input dd in insert mode

However, if you are in command mode, the string 10dd will delete 10 lines starting from the current cursor position of the temporary file, as shown in figure 2.

Figure 2. Enter dd in command mode

Another example is moving the cursor. In command mode, keys H, J, K, and L move the cursor to the left, bottom, and right, as shown in 3. In insert mode, these letters are displayed.

Figure 3. move the cursor in vi

Generally, UNIX users use vi, or Editor Macros (Emacs), which was written by Richard Stallman in 1976. But many people choose vi because it is lightweight, faster to start, and consumes less memory.

[1] [2] [3] [4] [5] Next page

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.