ArticleslgStudy

computer science

Vim (text editor)

Vim (text editor) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Vim (text editor) rather than just read about it. In short: Vim ( ; short for vi improved) is a free and open-source text editor. Vim provides both a terminal screen user interface as well as a graphical user interface (called gvim).

Vim (text editor) — main illustration
Vim (text editor) — illustration

Key takeaways

  • Vim (text editor) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Vim (text editor) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Vim (text editor) from memory before moving on to harder problems.

Reference excerpt

Vim ( ; short for vi improved) is a free and open-source text editor. Vim provides both a terminal screen user interface as well as a graphical user interface (called gvim). Vim's documentation describes it as an improved form of the older vi text editor (though it is built from a distinct codebase). In release information, the author originally implied that Vim was an abbreviation for "Vi IMitation", but later, the expansion was changed to "Vi IMproved" because, as described by the author, the functionality had increased beyond that of a clone of vi. Some sources indicate the change happened with v2.0, but conflicting information (including from author) suggests the change happened as early as v2.0 and as late as v3.0. Since its original release for the Amiga, Vim has been ported to many environments including Atari MiNT, BeOS, MS-DOS, Windows starting from Windows NT 3.1, OS/2, OS/390, MorphOS, OpenVMS, QNX, RISC OS, Linux, BSD, and Classic Mac OS. Vim is also shipped with Apple macOS. Independent ports of Vim are available for Android and iOS. Vim has been and continues to be popular for software development. In 2018, it was voted the most popular editor amongst Linux Journal readers. In 2015, the Stack Overflow developer survey found it to be the third most popular text editor, and, in 2019, the fifth most popular development environment.

History In 1988, Bram Moolenaar began work on what would become Vim. He used the codebase for the Stevie editor ported to Amiga (by Tony Andrews et al.) as a starting point. Version 1.14 (completed 2 November 1991) became the first public release. It was distributed via Fish Disk #591 in January 1992.

License Vim is released under the Vim license, which includes some charityware clauses that encourage users who enjoy the software to consider donating to children in Uganda. The Vim license is compatible with the GNU General Public License through a special clause allowing distribution of modified copies under the GNU GPL version 2.0 or later.

User experience

Text user interface Building upon the core vi functionality, Vim provides a user experience that integrates keyboard-entered command input with a full-screen editing experience. Vim allows a user with a typical keyboard to keep their fingers on the home row, which can be an advantage for touch typing.

Graphical user interface Via its GUI mode (called gVim), it presents an interface with a more modern experience including aspects such as menus, toolbars and icons. The full functionality is still expressed through its command line mode.

Help Vim has a built-in help facility accessible via the :help command. The Vim tutorial for beginners, called vimtutor, is usually installed alongside Vim, but is a separate executable and can be run separately. The Vim Users' Manual details Vim's features and can be read from within Vim, or found online.

Registers Vim features various special memory entries called registers (not to be confused with hardware or processor registers). When cutting, deleting, copying, or pasting text the user can choose to store the manipulated text in a register. There are 36 general-purpose registers associated with letters and numbers ([a-z0-9]) and a range of special ones that either contain special values (current filename, last command, etc.) or serve a special purpose.

Modes

Like vi, Vim supports multiple editing modes. Depending on the mode, entered characters are either processed as command input or inserted as text. Vim has 14 modes (7 basic modes and 7 variants):

Normal: For editor commands. Generally, this is the default mode and ESC enters this mode. Insert: For editing content like in a modern editor. Visual: For selecting areas of text. Commands can be run on the selected area – moving, editing, filtering via built-in or external command, etc. Visual linewise: Selects one or more whole lines. Visual blockwise: Selects a rectangular block of text across one or more lines. Select: Similar to visual, but commands are not interpreted. Instead, highlighted text is directly replaced by input from the keyboard. This behavior mimics the selection mode in editors on Windows platforms. Command-line (Cmdline): Provides a single line input at the bottom of the terminal. Commands (beginning with :) and some other keys for specific actions (including pattern search and the filter command) activate this mode. On completion of the command, Vim reverts to the previous mode. Ex: Accepts a sequence of commands. Terminal-Job: Interacting with a job in a terminal window.

Customization Vim is customizable and extensible, making it attractive to those who want control and flexibility in a text editing environment. Users can execute complex commands with key bindings, which can be customized and extended. The recording feature allows for the creation of macros to automate sequences of keystrokes and call internal or user-defined functions and mappings. Abbreviations, similar to macros and key mappings, facilitate the expansion of short strings of text into longer ones and can also be used to correct mistakes. Vim also features an easy mode for users wanting a simpler user experience. There are many plugins available that extend or add new functionality to Vim. These plugins are usually written in Vim's internal scripting language, vimscript (also known as VimL), but can be written in other languages as well. There are projects bundling together complex scripts and customizations and aimed at turning Vim into a tool for a specific task or adding a major flavour to its behaviour. Examples include Cream, which makes Vim behave like a click-and-type editor, or VimOutliner, which provides a comfortable outliner for users of Unix-like systems.

… excerpt ends here. Continue reading the full article.

Illustrations

Vim (text editor) illustration
Vim (text editor) illustration
Vim (text editor): gVim 7.3
gVim 7.3
Vim (text editor): Vim modes
Vim modes

Worked examples

Example 1 — a first encounter with Vim (text editor)

Start with the simplest possible case. Write down what Vim (text editor) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Vim (text editor) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Vim (text editor) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Vim (text editor)

In research
Vim (text editor) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Vim (text editor) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Vim (text editor) is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1991 software, Amiga software, BeOS text editors, so understanding it makes those chapters shorter.
In everyday life
Look for Vim (text editor) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Vim (text editor)” →

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Vim (text editor) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Vim (text editor) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Vim (text editor) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Vim (text editor) in simple terms?

Vim ( ; short for vi improved) is a free and open-source text editor. Vim provides both a terminal screen user interface as well as a graphical user interface (called gvim).

Why does Vim (text editor) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Vim (text editor)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Vim (text editor).

Tags

  • 1991 software
  • Amiga software
  • BeOS text editors
  • Classic Mac OS text editors
  • Computer science in the Netherlands
  • Console applications
  • Cross-platform free software
  • DOS text editors
  • Free HTML editors
  • Free file comparison tools
  • Free software programmed in C
  • Free text editors

Keep exploring