Free Sample
+ Collection

Hacking Vim: A Cookbook to get the Most out of the Latest Vim Editor

Kim Schulz

From personalizing Vim to productivity optimizations: Recipes to make life easier for experienced Vim users
RRP $23.99
RRP $39.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781847190932
Paperback228 pages

About This Book

  • Create, install, and use Vim scripts
  • Personalize your work-area
  • Optimize your Vim editor to be faster and more responsive


Who This Book Is For

Anyone who has worked with Vim and wants to get more out of this legendary text editor can use the hacks from this book. It does not cover the basic tasks of using the editor but instead focuses on making life easier for more experienced Vim users.

Buy Hacking Vim: A Cookbook to get the Most out of the Latest Vim Editor


Table of Contents

Chapter 1: Introduction
Vi, Vim, and Friends
Vim is Charityware
Chapter 2: Personalizing Vim
Where are the Config Files?
Personal Highlighting
Work Area Personalization
Chapter 3: Better Navigation
Faster Navigation in a File
Navigating Long Lines
Search and You Will Find
X Marks the Spot
Chapter 4: Production Boosters
Using Templates
Using Auto-Completion
Using Sessions
Registers and Undo Branching
Chapter 5: Advanced Formatting
Formatting Text
Chapter 6: Vim Scripting
Using Scripts
Script Development

What You Will Learn

Chapter 1 introduces Vim and a few well-known relatives; their history and relation to vi is briefly described.

Chapter 2 introduces how to make Vim a better editor for you by modifying it for your personal needs. It shows us ways of modifying fonts, the color scheme, the status line, menus, and toolbar.

Chapter 3 introduces some of the ways in which Vim helps us to navigate through files easily. It explains an alternative way for boosting navigation through files and buffers in Vim.

Chapter 4 introduces you to features in Vim. It describes how to use templates, auto-completion, folding, sessions, and registers.

Chapter 5 introduces simple tricks to format text and code. It also discusses how external tools can be used to give Vim just that extra edge it needs to be the perfect editor.  

Chapter 6 is especially for those who want to learn how to extend Vim with scripts. The chapter introduces scripting basics, how to use and install/uninstall scripts, debugging scripts, and lots more.

Appendix A has a listing of games that have been implemented with Vim scripting; it also provides an overview of chat and mail scripts and has a section on using Vim as an IDE.

Appendix B shows how to keep your Vim configuration files well organized and how to retain your Vim configuration across computers by storing a copy of it online

In Detail

Each chapter of this book 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.

Vim stands for Vi IMproved and is the editor of choice for programmers looking for a highly configurable, stable, open-source, multi-platform text editor. It is included with almost every Linux distribution as the standard text editor, and can be used to work with source code from any language. A big advantage of using Vim is that it can be extensively customized; you can control the basic interface, define personalized key mappings, implement macros, and call external or user-defined scripts. Vim has its own scripting language that allows for plug-in like extensions to enable IDE behavior, syntax scripts and highlighting, color schemes, themes, and utility scripts that can add a wide range of features and functionality.
Vim 7.0, for which this book is written, includes spell-checking, code completion, document tabs, current line and column highlighting, undo branches, and more.


Read More