Vim (Vi IMproved) is an enhanced version of the text editor that is available on all UNIX systems.
What is Vim?
Its author, Bram Moolenaar, introduced its first version in 1991, making many improvements since then. The main feature of both Vim and Vi is that they have different modes that they change to perform certain operations, making them distinct from the most common editors that have a single mode in which directives are entered with critical combinations or graphic interfaces.
Vi IMproved
Vim is used from a text-mode terminal like its predecessor, vi. The keyboard fully controls it. This is because Vi was developed in the mid-1970s when the terminals communicated with a host over a not-too-fast (20 Kbps) serial connection. The limitations of time terminals have led to different ways of concept, an idea that has been very profitable up to that time.
Vim is almost 100% compatible with vi. Still, although it has many improvements, it has a simplified version that acts like a graphic interface menus-editable versions and an editor without different modes.
Vim versions are available for many operating systems and can be found on almost all GNU/Linux systems and all BSD systems where it can be run with the vi command, which calls Vim with a symbolic link or alias. When Vim starts, it does it in command mode and displays the version on the screen.
When Bram Moolenar purchased an Amiga computer in the late 1980s, he wanted to continue using the Unix editor he was used to, but vi clones that Amiga could use did not convince him. So in 1988, to start developing Vim, vi clone started from Stevie 1.0.
At first, vi was called IMitation (vi imitation) because, initially, its primary purpose was to imitate the functions available in the new system of vi. Version 1.14 appeared in the free software collection “Fred Fish disk # 591” for Amiga in 1991. Version 1.22 is the first release with Unix and MS-DOS versions. The abbreviation that gave its name to that time was changed to Vi IMproved.
In the years that followed, Vim made significant progress. An important step was taken to include Windows in version 3.0 (1994). You can open several files in the same session as Vi, but you can only see one at a time; Vim allows you to view windows simultaneously.
Since version 4.0 (1996), a graphical user interface (GUI) has been available that Robert Webb started developing. Since version 5.0 (1998), Vim has syntax highlighting.
Features
- We have integrated a spell checker.
- Autocomplete text.
- Tab navigation.
- Multiple windows that divide the editing area horizontally or vertically.
- We are highlighting syntax depending on the programming language or tags used.
- Retrieves and repeats directives.
- I am understanding more than 200 different syntaxes.
- Scripting language to program extensions.
- Commands are completed with words and filenames.
- File compression and decompression make it possible to edit compressed files.
- Recognizing file formats and converting between them.
- History of the directives enforced.
- Macro recording and playback.
- Saves the settings between sessions.
- Automatic and manual code folding.
- Optional graphic interface.
- It is highly configurable and customizable.
- It is almost 100% compatible with Vi.
Help
Vim has excellent documentation managed by the maxim, an undocumented feature that is useless. Documents in text form are very comprehensive and easy to understand.
The user accesses the description of various functions that can solve their problems through a search. Keywords are highlighted, highlighting the syntax of Vim’s help. When the cursor is over a keyword, you can navigate through the help using key combinations and return if necessary.
You can also use the mouse for this purpose in the graphic version. The helpgrep command is important because it allows the user to search for a word in help texts without the need for a keyword. Help is complemented by a version of HTML available for online consultation and a comprehensive list of frequently asked questions (FAQs).
Advantages
Vim is an editor made by programmers for programmers. To facilitate programming, Vim has an “edit, compile, correct” mode. As with integrated development environments, you can edit the source code, call an external compiler, and interpret the results. If there are compilation errors, they are displayed in a window.
Error messages direct the user to the region where they can be corrected. Then the “edit, compile, fix” and, if necessary, a new correction cycle starts again. The function of syntax highlighting and code folding also facilitates the developer’s job.
File Comparison
Comparing two (or more) versions of a file is common for some users. Vim offers a simple solution: two different versions of the file are shown in two adjacent windows, where differences are highlighted. In this way, the differences between the versions can be seen in color. For example, deletions appear in red, and new attachments appear in purple.
In addition to converting these differences to another file, some commands allow you to place the cursor over the following and previous differences.
Interpreted Language
Vim has an interpreted language or script to program new functions where you can automate specific processes that are too complex to be performed with a macro. Scripts can be read and interpreted using the source command.
Modes
Vim is a permanent editor, so you can work in different modes to perform a specific task. The showmode option must be enabled to see which mode the Vim is in.
The six Vim modes are described below. The first three are the original vi modes. The five additional modes should not be understood separately but should be understood together with the fundamental mode. Also, see Vim’s help on this topic: help vim-modes.
Command Mode
Vim starts in command mode, also known as normal mode. In this mode, you can use key combinations to copy lines and work in text format. This is the central mode where you switch to other modes. If you don’t know what you are doing, you can always return to normal mode by pressing the Escape key twice. If it is already in normal mode and allows both Vim and terminal settings, Vim will beep.
Adding Mode
When the keys are pressed in insert mode, the text is edited just like any other editor. You can switch from command mode to insert mode by pressing the “i” key.
For example, at the end of the line, there are a wide variety of commands to switch to the insert mode, which is vastly different because they allow editing at a certain point in the text, that is, by deleting a word. A skilled user can significantly benefit from the presence of such various orders.
In addition mode, all keys have some functions that are activated by simply pressing the Control key or Shift keys at the same time as well as adding them. The Esc key is fundamental in insert mode because it allows you to switch from insert mode to command mode.
Switching to command mode to perform specific tasks significantly improves editing efficiency, and you can take full advantage of Vim’s power.
Command Line Mode
This mode is accessed by pressing the colon (:) repeatedly. After the colon, you can enter complex commands, such as search, and replace them with regular expressions. You can return to command mode by pressing the Esc button.
Visual Mode
This model is a mod developed over vi. You can mark a text field (a group of lines or a block) by using specific key combinations with the cursor movement keys. Once the text is marked, you can use the command mode’s commands to change it. Operations that can be performed in this mode are simpler than operations in command mode.
Selection Mode
This mode starts as a visual mode because you have to choose a block of text. After selection, you can switch to selection mode using the Control-G button. In the mode, if a printable key is pressed, the selected text is deleted, the selection mode ends, and the symbol corresponding to the key pressed appears.
The selection can be expanded by pressing the shift and arrow keys, the usual behavior in Microsoft Windows programs. This mode can be terminated by pressing the Escape key.
Ex Mode
This mode is similar to command line mode, but it does not return to command mode after an order is executed. This mode is entered by pressing the Q button and ends with vi. In this mode, Vim simulates the old UNIX software, which changes text line by line rather than editing the entire page due to time limitations.
gVIM
gVim is the graphic version of the Vim software. Works with gVim gtk libraries. It preserves the functions of Vim and adds menus and a graphical environment.
Its main advantage includes drop-down menus for new users and a slightly less complicated learning curve. Its primary disadvantage is that it is not installed on all systems by default.
Operating Systems
One virtue of Vim is that it can be run on many operating systems. This is important for users like system administrators who need to work on many different platforms.
It can be run on the following operating systems: AmigaOS, Atari MiNT, BeOS, DOS, GNU / Linux, Mac OS, NextStep, OS/2, OSF, RISC OS, IRIX, Unix (BSD, AIX and HP-UX), VMS and Windows 3. x/95/98/ME/2000/NT/XP.
Advantages of Use
Most users claim that this editor increases productivity when compared to more straightforward editors when it overcomes the learning curve. Key combinations can be memorized using reminder methods as they relate to English words.
The unique complexity of the learning instructions is rewarded with increased efficiency. Expert users can copy, format, or sort the text in many different ways, using a few shortcuts, which can only be done with much more complex operations in many editors.
Some experience is sufficient to realize that combinations of instructions that allow complex text editing with Vim are facilitated. On the other hand, new versions will enable you to use the mouse and add graphic menus that make it easier to work with Vim and other editors. Due to its small size and speed on UNIX-based platforms with limited resources, it is often installed as a basic editor.
Awards
Vim won the Linux Journal Readers’ Choice Awards in the Favorite Text Editor category from 2001-2005 and received the Slashdot Bernie Award for the Best Open Source Text Editor and the 1999 LinuxWorld Editor’s Choice Award.
License
Vim is distributed under a Charityware license that is compatible with the GNU General Public License. This means that Vim is subject to the same conditions, but users are encouraged to donate to orphan children in Uganda through the ICCF Holland organization.
Community
Vim, Bram Moolenaar, and many volunteers developed it. More than 50 participants are on the current version of the Vim help page.
In addition, there are a large number of people who help not only develop the software but also move it to other operating systems, test new versions, report bugs, write documents, and translate the help system. They also adapt Vim to different projects and many other things, answering user questions.
All users can contribute by writing scripts or giving advice. There is a very active mailing list with helpful, fast, and competent responses for both new and experienced users.