Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Mastering Vim

You're reading from   Mastering Vim Efficient and effortless editing with Vim and Vimscript

Arrow left icon
Product type Paperback
Published in Jul 2024
Publisher Packt
ISBN-13 9781835081877
Length 300 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Ruslan Osipov Ruslan Osipov
Author Profile Icon Ruslan Osipov
Ruslan Osipov
Arrow right icon
View More author details
Toc

Table of Contents (11) Chapters Close

Preface 1. Chapter 1: Getting Started FREE CHAPTER 2. Chapter 2: Advanced Editing and Navigation 3. Chapter 3: Follow the Leader Plugin Management 4. Chapter 4: Understanding Structured Text 5. Chapter 5: Build, Test, and Execute 6. Chapter 6: Refactoring Code with Regex and Macros 7. Chapter 7: Making Vim Your Own 8. Chapter 8: Transcending the Mundane with Vimscript 9. Chapter 9: Where to Go from Here 10. Index

A brief history lesson

Let’s go back to the beginning of time: the middle of the twentieth century. Before personal computers and terminals, there were teleprinters. A teleprinter is a mechanical typewriter that can send and receive messages over a telecommunications channel. Here’s a photo of the Teletype ASR-33 (1963) teleprinter – a fancy typewriter that was used as an interface and an input device for a computing machine:

Figure 1.1 –  Teletype Corporation ASR-33 teleprinter (image by Arnold Reinhold, Wikipedia (CC BY-SA 3.0))

Figure 1.1 – Teletype Corporation ASR-33 teleprinter (image by Arnold Reinhold, Wikipedia (CC BY-SA 3.0))

The only way to engage with the text through teleprinters was line by line, so line editors such as ed (developed by Ken Thompson) or its successor – Bill Joy’s ex – were used. Line editors were, just like Vim is today, modal editors (more about that in a bit) but, due to aforementioned input/output limitations, were limited to working on one line at a time. Yes, really.

As technology progressed, teleprinters were replaced by terminals with screens, which enabled much more robust text editing. Vim’s direct predecessor, vi, started its life all the way back in 1976. Unlike its predecessors, vi (developed by Bill Joy, the author of ex) included many quality-of-life features and even allowed you to edit multiple lines of text at once – what a luxury!

Did you know?

On many modern systems, the vi command is a symlink to a feature-limited version of vim referred to as vim-tiny (rather than the original vi implementation)!

Vi inspired many clones, including STEVIE (ST Editor for VI Enthusiasts): and STEVIE source code is what was eventually used as a basis for Vim. The first version of Vim was released in 1991 by Bram Moolenaar. Now, you’re all caught up!

While it’s not very likely that you’ll stumble upon a device with Vim that hasn’t been updated since the late 1990s, it helps to get a basic idea of what changed between different Vim versions.

Here, you can see the (oversimplified) highlights of each major version of Vim up until the moment of writing the second edition of this book. Vim has been in some form of continuous development since 1991!

Major version

Years

Highlights

1.0

1991

Bram Moolenaar releases Vi Imitation for the Amiga computer.

2.0

1993

Vi Improved is released under its modern name!

3.0

1994

Multiple windows.

4.0

1996

Graphical interface support.

5.0 – 5.8

1998 – 2001

Syntax highlighting, scripting, and select mode are added.

6.0 – 6.4

2001 – 2005

Plugin support and folding support are added.

7.0 – 7.4

2006 – 2013

Notable new features include spell checking, code completion, tabs, branching history, and persistent undo.

8.0 – 8.2

2016 – 2019

Optimizations, asynchronous I/O support, built-in terminal, and pop-up windows are available.

9.0

2022

Introduction of the new scripting language (Vim9script).

Just like with vi, there are many Vim clones, and some are quite successful. This book covers one of the more successful alternative implementations of Vim in Chapter 9.

Ask for :help

If you’re interested in a more detailed breakdown of the differences between the versions, you can open :help (you’ll learn how to use that by the end of the chapter) and look for “Versions”. Try :help version9 to see what’s new in Vim 9!

You have been reading a chapter from
Mastering Vim - Second Edition
Published in: Jul 2024
Publisher: Packt
ISBN-13: 9781835081877
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image