Learn Vimscript the Hard Way
It is not a guide to using Vim. Before reading this book you should be comfortable editing text in Vim and know what terms like "buffer", "window" and "insert mode" mean.
The book is divided roughly into three sections:
The first covers basic Vim commands that you can use in your ~/.vimrc file to customize Vim quickly and easily.
The second looks more deeply at Vimscript as a programming language, covering things like variables, comparisons, and functions.
The third walks through the creation of a sample plugin intended for distribution to other Vim users.