Book Image

Hacking Vim 7.2

By : Kim Schulz
Book Image

Hacking Vim 7.2

By: Kim Schulz

Overview of this book

<p>Vim is one of the most powerful open-source editors used by programmers and system administrators around the world. While Vim itself is inherently a powerful editor, personalizing it to suit your needs can be a daunting task. However, it is possible to do so with the help of this book.<br /><br />This book contains examples that cover everything from personalizing Vim according to the your work cycle to optimizations that will boost the your productivity. The main focus of this book is to make your life, as a Vim user, easier.<br /><br />Each chapter deals with a different aspect, and provides recipes for easy-to-use hacks to customize and simplify your Vim experience. After an introduction covering the derivation of Vim and its relatives from the vi editor, the author explains basic changes that you can make to the appearance of the Vim editor. Further chapters cover improved navigation through files and buffers in Vim; speeding up your work with templates, auto-completion, folding, sessions, and registers; and formatting text and code, including using external formatting scripts. The final comprehensive chapter covers everything about using Vim scripts and scripting to extend functionality.<br /><br />This book is written for Vim 7.2, the latest stable version. This latest version of Vim includes many new features like spell-checking, code completion, document tabs, current line and column highlighting, undo branches, and much more.</p>
Table of Contents (15 chapters)
Hacking Vim 7.2
Credits
About the Author
About the Reviewers
Preface
Index

A more informative status line


At the bottom of the Vim editor, you will find two things:

  • The command line buffer (where you can input commands)

  • The status line

In the default configuration, Vim has a simple and quite non-informative status line. To the right it shows the number of the current row and column, and to the left it shows the name of the file currently open (if any).

Whenever you execute a Vim command, the status line will disappear and the command buffer will be shown in that line instead. If the command you execute writes any messages, then those will be shown on the right of the status line.

For simple and fast file editing, this status line is adequate. But if you use Vim everyday and for a lot of different file formats, it would be nice to have a more informative status line.

In this recipe, we see some examples of how the status line can be made a lot more informative with simple methods.

The command that sets how the status line should look is simply called:

:set statusline...