vim Tutorial

vim is a text editor. A text editor is a software that help you create and modify text files. There are a lot of text editors, but vim is the best of them. If all you need is small, light-weight and casual text editing, perhaps simple editors like notepad in Windows, pico in Unix, will make you happy. If most of your time is devoted to text editing, perhaps you should consider an editor of power, which is vim, of course. Choosing vim may bring dramatic changes to your productivity and your life.

What is good in vim as an editor

What about Vi

The Unix editor vi has a long history, and is the one that vim is based on. I believe that the power, beauty and essence of vim always come from vi. A real vim user doesn't mind using vi temporarily, but feels great pain if forced a thing like Emacs. vim retains all the powers of vi, plus a lot of improvements and new features. And now vim is running virtually all platforms. So I see no reason to choose vi over vim.

To know other things about vim, and to download a copy, check its main developer, Bram Moolenaar's vim home page, where you can also find a lot of other vim sites.

About this document

This document is a tutorial written for new vim users. The purpose is to use plain language and easily readable html format to introduce the way vim works and the most basic vim features. I think this small fraction of vim features is enough to make you feel the power you have never felt with other editors. This document is merely a recording of my own experience of using vim, and bears many of my personal views. Therefore it is by no means guaranteed to be correct, precise, or complete. This document is free and can be freely distributed. If you find mistakes, have any suggestions, or have a question about vim, you're welcome to send me an email.

Copyright (c) 2002 Xiaorang Li (xli5@uwo.ca)
Minor modification by David B. Dahl, Fall 2005

Table of Contents

Get started

Basic stuff that helps you work with vim right away

The modal editor

The different modes of vim

Move cursor

Various ways to move cursor around and locate your target quickly

Modify text

Insert, delete, replace, and change text

Select, cut, copy and paste

Select, cut, copy and paste; visual mode; named buffer

Search and substitute

Search and substitute strings

Abbreviate and map

Save key strokes by abbreviation and define new commands by mapping

Manipulate files

Open, save, read from, and write to file, split windows

Set options

Customize your vim

More features

multiple level undo, syntax highlighting, recording, Ex commands, command-line editing, folding, encryption...

Command list

List of common commands and examples for quick reference

© Xiaorang Li