VIM USER MANUAL - by Bram Moolenaar

Table Of Contents *user-manual*

==============================================================================

Overview ~

Getting Started ~

About the manuals

The first steps in Vim

Moving around

Making small changes

Set your settings

Using syntax highlighting

Editing more than one file

Splitting windows

Using the GUI

Making big changes

Recovering from a crash

Clever tricks

Editing Effectively ~

Typing command-line commands quickly

Go away and come back

Finding the file to edit

Editing other files

Inserting quickly

Editing formatted text

Repeating

Search commands and patterns

Folding

Moving through programs

Editing programs

Exploiting the GUI

The undo tree

Tuning Vim ~

Make new commands

Write a Vim script

Add new menus

Using filetypes

Your own syntax highlighted

Select your language (locale)

Writing Vim script ~

Advanced Vim script writing

Write plugins

Write larger plugins

Making Vim Run ~

Installing Vim

Reference manual ~

|reference_toc| More detailed information for all commands

The user manual (an older version) is available as a single, ready to print

HTML and PDF file here:

http://vimdoc.sf.net

==============================================================================

Getting Started ~

Read this from start to end to learn the essential commands.

About the manuals

|01.1| Two manuals

|01.2| Vim installed

|01.3| Using the Vim tutor

|01.4| Copyright

The first steps in Vim

|02.1| Running Vim for the First Time

|02.2| Inserting text

|02.3| Moving around

|02.4| Deleting characters

|02.5| Undo and Redo

|02.6| Other editing commands

|02.7| Getting out

|02.8| Finding help

Moving around

|03.1| Word movement

|03.2| Moving to the start or end of a line

|03.3| Moving to a character

|03.4| Matching a paren

|03.5| Moving to a specific line

|03.6| Telling where you are

|03.7| Scrolling around

|03.8| Simple searches

|03.9| Simple search patterns

|03.10| Using marks

Making small changes

|04.1| Operators and motions

|04.2| Changing text

|04.3| Repeating a change

|04.4| Visual mode

|04.5| Moving text

|04.6| Copying text

|04.7| Using the clipboard

|04.8| Text objects

|04.9| Replace mode

|04.10| Conclusion

Set your settings

|05.1| The vimrc file

|05.2| The example vimrc file explained

|05.3| The defaults.vim file explained

|05.4| Simple mappings

|05.5| Adding a package

|05.6| Adding a plugin

|05.7| Adding a help file

|05.8| The option window

|05.9| Often used options

Using syntax highlighting

|06.1| Switching it on

|06.2| No or wrong colors?

|06.3| Different colors

|06.4| With colors or without colors

|06.5| Printing with colors

|06.6| Further reading

Editing more than one file

|07.1| Edit another file

|07.2| A list of files

|07.3| Jumping from file to file

|07.4| Backup files

|07.5| Copy text between files

|07.6| Viewing a file

|07.7| Changing the file name

Splitting windows

|08.1| Split a window

|08.2| Split a window on another file

|08.3| Window size

|08.4| Vertical splits

|08.5| Moving windows

|08.6| Commands for all windows

|08.7| Viewing differences with vimdiff

|08.8| Various

Using the GUI

|09.1| Parts of the GUI

|09.2| Using the mouse

|09.3| The clipboard

|09.4| Select mode

Making big changes

|10.1| Record and playback commands

|10.2| Substitution

|10.3| Command ranges

|10.4| The global command

|10.5| Visual block mode

|10.6| Reading and writing part of a file

|10.7| Formatting text

|10.8| Changing case

|10.9| Using an external program

Recovering from a crash

|11.1| Basic recovery

|11.2| Where is the swap file?

|11.3| Crashed or not?

|11.4| Further reading

Clever tricks

|12.1| Replace a word

|12.2| Change "Last, First" to "First Last"

|12.3| Sort a list

|12.4| Reverse line order

|12.5| Count words

|12.6| Find a man page

|12.7| Trim blanks

|12.8| Find where a word is used

==============================================================================

Editing Effectively ~

Subjects that can be read independently.

Typing command-line commands quickly

|20.1| Command line editing

|20.2| Command line abbreviations

|20.3| Command line completion

|20.4| Command line history

|20.5| Command line window

Go away and come back

|21.1| Suspend and resume

|21.2| Executing shell commands

|21.3| Remembering information; viminfo

|21.4| Sessions

|21.5| Views

|21.6| Modelines

Finding the file to edit

|22.1| The file explorer

|22.2| The current directory

|22.3| Finding a file

|22.4| The buffer list

Editing other files

|23.1| DOS, Mac and Unix files

|23.2| Files on the internet

|23.3| Encryption

|23.4| Binary files

|23.5| Compressed files

Inserting quickly

|24.1| Making corrections

|24.2| Showing matches

|24.3| Completion

|24.4| Repeating an insert

|24.5| Copying from another line

|24.6| Inserting a register

|24.7| Abbreviations

|24.8| Entering special characters

|24.9| Digraphs

|24.10| Normal mode commands

Editing formatted text

|25.1| Breaking lines

|25.2| Aligning text

|25.3| Indents and tabs

|25.4| Dealing with long lines

|25.5| Editing tables

Repeating

|26.1| Repeating with Visual mode

|26.2| Add and subtract

|26.3| Making a change in many files

|26.4| Using Vim from a shell script

Search commands and patterns

|27.1| Ignoring case

|27.2| Wrapping around the file end

|27.3| Offsets

|27.4| Matching multiple times

|27.5| Alternatives

|27.6| Character ranges

|27.7| Character classes

|27.8| Matching a line break

|27.9| Examples

Folding

|28.1| What is folding?

|28.2| Manual folding

|28.3| Working with folds

|28.4| Saving and restoring folds

|28.5| Folding by indent

|28.6| Folding with markers

|28.7| Folding by syntax

|28.8| Folding by expression

|28.9| Folding unchanged lines

|28.10| Which fold method to use?

Moving through programs

|29.1| Using tags

|29.2| The preview window

|29.3| Moving through a program

|29.4| Finding global identifiers

|29.5| Finding local identifiers

Editing programs

|30.1| Compiling

|30.2| Indenting C files

|30.3| Automatic indenting

|30.4| Other indenting

|30.5| Tabs and spaces

|30.6| Formatting comments

Exploiting the GUI

|31.1| The file browser

|31.2| Confirmation

|31.3| Menu shortcuts

|31.4| Vim window position and size

|31.5| Various

The undo tree

|32.1| Undo up to a file write

|32.2| Numbering changes

|32.3| Jumping around the tree

|32.4| Time travelling

==============================================================================

Tuning Vim ~

Make Vim work as you like it.

Make new commands

|40.1| Key mapping

|40.2| Defining command-line commands

|40.3| Autocommands

Write a Vim script

|41.1| Introduction

|41.2| Variables

|41.3| Expressions

|41.4| Conditionals

|41.5| Executing an expression

|41.6| Using functions

|41.7| Defining a function

|41.8| Lists and Dictionaries

|41.9| White space

|41.10| Line continuation

|41.11| Comments

|41.12| Fileformat

Add new menus

|42.1| Introduction

|42.2| Menu commands

|42.3| Various

|42.4| Toolbar and popup menus

Using filetypes

|43.1| Plugins for a filetype

|43.2| Adding a filetype

Your own syntax highlighted

|44.1| Basic syntax commands

|44.2| Keywords

|44.3| Matches

|44.4| Regions

|44.5| Nested items

|44.6| Following groups

|44.7| Other arguments

|44.8| Clusters

|44.9| Including another syntax file

|44.10| Synchronizing

|44.11| Installing a syntax file

|44.12| Portable syntax file layout

Select your language (locale)

|45.1| Language for Messages

|45.2| Language for Menus

|45.3| Using another encoding

|45.4| Editing files with a different encoding

|45.5| Entering language text

==============================================================================

Writing Vim script ~

Advanced Vim script writing

|50.1| Exceptions

|50.2| Function with variable number of arguments

|50.3| Restoring the view

Write plugins

|51.1| Writing a generic plugin

|51.2| Writing a filetype plugin

|51.3| Writing a compiler plugin

|51.4| Distributing Vim scripts

Write larger plugins

|52.1| Export and import

|52.2| Autoloading

|52.3| Autoloading without import/export

|52.4| Other mechanisms to use

|52.5| Using a Vim9 script from legacy script

==============================================================================

Making Vim Run ~

Before you can use Vim.

Installing Vim

|90.1| Unix

|90.2| MS-Windows

|90.3| Upgrading

|90.4| Common installation issues

|90.5| Uninstalling Vim

==============================================================================

Copyright: see |manual-copyright| vim:tw=78:ts=8:noet:ft=help:norl: