Vi and vim Editor (13): Overview of Functions of similar vi products, vivim

Source: Internet
Author: User

Vi and vim Editor (13): Overview of Functions of similar vi products, vivim

This chapter describes the functions provided by similar products of vi.

They are all my brothers:

There are many similar products of the vi editor that can be freely obtained. Vi and vim editor focuses on the vim editor and briefly introduces three other common similar products: nvi, elvis, and vile. These similar products provide many extension functions other than vi, although the methods may be different, but these similar products usually provide the same extension function. This article will introduce the extended functions provided by these similar products in general.

Multi-Window Editing:You can split the screen into multiple "Windows" to edit different files in each window, or observe different parts of the same file. This makes it easier to work in multiple files at the same time and cut text between files.

Graphical user interface:Except nvi, all similar products can be compiled to support the X Window Interface.

Extended regular expression:I have learned the metacharacters of the regular expression that can be used for searching and replacing modes in the vi editor. Each type of similar product provides a certain form of extension regular expression, but each extension method has a different "flavor.

Enhanced labels:The "Exuberant ctags" program is similar to ctags. More powerful than ctags on UNIX. You can generate an extended tags file format to make tag search and matching more flexible and powerful. The following are special features of "Exuberant ctags:

  • Supports C and C ++ code, and 29 programming languages, including C # and java;
  • Can generate all types of C and C ++ language labels;
  • It is very reliable when parsing code;
  • Lists the selected objects in the source file for reading;
  • Supports generating tag files in the GNU Emacs style;

A traditional tags file has three fields separated by tabs: The Tag Name (usually the identifier), the source file containing the tag, and the identifier. The indicator can be a simple row number or a nomagic search mode enclosed by a diagonal line or question mark. The new format is backward compatible with the traditional format. The preceding three fields are still the same: Tag, file name, and search mode. Exuberant ctags only produces the search mode, rather than any command. Extended attributes are placed after the separator. Attributes are separated by tab characters. Each attribute is composed of two child fields separated by a colon. The first child field is the keyword describing the attribute. The default value is kind (this can be omitted at this time ), the second is the actual value. For the extended ctags keyword, refer to vi and vim editor p144. Shows an example of extending the tags file:

In front of the tags file "! The initialization TAG starting with _ TAG _ "is helpful for identifying programs that create files. The editor may also use these special tags to implement special functions. The corresponding label definition is followed.

Tag Stack:Similar products of each type of vi have extended the function of maintaining the tag stack. Each time you use the ": tag" command or "^]" command in vi to search for a tag, the editor first saves the current location. In this way, you can use the "CTRL + T" command or the ex command in the vi editor to return to the saved location. The label stack function of vim will be further studied in subsequent articles.

Improved editing tools:All similar products provide the ability to edit the ex command line, undo it for unlimited times, support row and eight-digit data of any length, and perform incremental search, scroll the screen from left to right to replace other features such as long lines, visual mode, and mode indicator.

Programming assistance:

Vi is an editor developed for programmers. It provides some functions to make it easier for traditional UNIX programmers (who write C Programs and troff documents) to work. Similar Products of vi provide more functions on this basis:

Edit-compile acceleration: during compilation, you do not need to leave the editor at all, and you can get the compiler output and automatically jump to the row containing the error.

Syntax highlight: Different syntax elements in the Code are displayed in different colors and fonts.


Summary of the vi commands in this chapter:

This chapter describes some extensions provided by similar vi products (vim, nvi, elvis, vile. Subsequent articles will focus on the details of various extensions of the vim editor.


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.